dr-bedrock

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Dr. Bedrock: Cline CLI Bedrock Auth Troubleshooter

Bedrock博士:Cline CLI Bedrock认证排查工具

Use this skill to diagnose local AWS Bedrock auth/configuration for the Cline CLI and report likely causes plus user-actionable fixes. This skill identifies problems only.
使用此工具诊断Cline CLI的本地AWS Bedrock认证/配置问题,报告可能的原因及用户可执行的修复方案。本工具仅负责识别问题。

Invocation rule

调用规则

When this skill is invoked, the first thing you say to the user must always be exactly:
text
Paging Dr. Bedrock...
Then proceed with diagnostics or reporting.
调用此工具时,首先必须对用户说以下内容:
text
Paging Dr. Bedrock...
之后再进行诊断或报告。

Hard safety rules

严格安全规则

  • DO NOT make any file changes on the system. You are not fixing the problem, only identifying it.
  • DO NOT read or print sensitive credentials. If reading a file that may contain credentials, use a command that filters or redacts credential values before they reach the transcript.
  • DO NOT suggest code changes in Cline. Suggest user fixes: AWS auth setup, Cline CLI upgrade, reconfigure provider, export environment variables, refresh SSO, request Bedrock model access, etc.
  • Avoid cost-incurring model invocations unless the user explicitly asks for a live invocation test. Prefer STS identity and Bedrock model-list/access checks.
  • 请勿对系统进行任何文件修改。 你仅负责识别问题,不负责修复。
  • 请勿读取或打印敏感凭证。 若读取可能包含凭证的文件,请使用能过滤或编辑凭证值的命令,避免凭证内容出现在记录中。
  • 请勿建议修改Cline的代码。 请建议用户执行以下操作:AWS认证设置、升级Cline CLI、重新配置提供商、导出环境变量、刷新SSO、申请Bedrock模型访问权限等。
  • 除非用户明确要求进行实时调用测试,否则避免会产生费用的模型调用。优先使用STS身份验证及Bedrock模型列表/访问检查。

What to determine

需要确认的内容

Classify the likely auth scheme, then validate region, credentials, Cline config, and Bedrock model access.
Auth schemes to consider:
  1. Bedrock API key: Cline config has
    apiKey
    or
    aws.authentication: "api-key"
    .
  2. Direct IAM keys in Cline config:
    aws.accessKey
    +
    aws.secretKey
    , optional
    aws.sessionToken
    .
  3. Named AWS profile:
    aws.authentication: "profile"
    and
    aws.profile
    , or
    AWS_PROFILE
    .
  4. Default AWS provider chain:
    aws.authentication: "iam"
    or profile auth with no saved profile name.
  5. AWS IAM Identity Center / SSO: profile contains
    sso_session
    ,
    sso_start_url
    ,
    sso_account_id
    , or
    sso_role_name
    .
  6. credential_process: profile contains
    credential_process
    .
  7. Assume role profile: profile contains
    role_arn
    with
    source_profile
    ,
    credential_source
    , or web identity.
  8. Web identity / OIDC:
    AWS_ROLE_ARN
    +
    AWS_WEB_IDENTITY_TOKEN_FILE
    or profile web identity settings.
  9. ECS/EC2 metadata: container metadata env vars or IMDS on EC2.
先判断可能的认证方案,再验证区域、凭证、Cline配置及Bedrock模型访问权限。
需考虑的认证方案:
  1. Bedrock API密钥:Cline配置中包含
    apiKey
    aws.authentication: "api-key"
  2. Cline配置中的直接IAM密钥
    aws.accessKey
    +
    aws.secretKey
    ,可选
    aws.sessionToken
  3. 命名AWS配置文件
    aws.authentication: "profile"
    aws.profile
    存在,或设置了
    AWS_PROFILE
  4. 默认AWS提供商链
    aws.authentication: "iam"
    ,或未保存配置文件名称的配置文件认证。
  5. AWS IAM身份中心/SSO:配置文件包含
    sso_session
    sso_start_url
    sso_account_id
    sso_role_name
  6. credential_process:配置文件包含
    credential_process
  7. 角色切换配置文件:配置文件包含
    role_arn
    source_profile
    credential_source
    或Web身份信息。
  8. Web身份/OIDC:设置了
    AWS_ROLE_ARN
    +
    AWS_WEB_IDENTITY_TOKEN_FILE
    ,或配置文件中有Web身份设置。
  9. ECS/EC2元数据:容器元数据环境变量或EC2上的IMDS。

Known Cline CLI Bedrock failure modes

已知Cline CLI Bedrock故障模式

Use these as recognition patterns, not as code-change recommendations:
SymptomLikely causeUser-facing fix
AWS region setting is missing. Pass it using the 'region' parameter or the AWS_REGION environment variable.
Older CLI provider path did not forward Bedrock region/options to the gateway (#10770; fixed by PR #10807 / related #10818).Upgrade Cline CLI. Work around by exporting
AWS_REGION=<region>
and reconfiguring Bedrock if upgrade is not possible.
Profile auth says provider configured, then no provider is readyOlder readiness logic treated Bedrock like API-key-only (#6958).Upgrade Cline CLI and re-run Bedrock provider setup.
AWS credential provider failed: Could not load credentials from any providers
with
credential_process
Missing/unsaved profile name, shared config not loaded, bad
credential_process
, or affected CLI build (#10930; PR #10932; legacy migration PR #10943).
Upgrade Cline CLI; ensure
aws.profile
or
AWS_PROFILE
names the profile; try
AWS_SDK_LOAD_CONFIG=1
; verify
aws sts get-caller-identity --profile <profile>
.
Migrated config has
aws.authentication: "profile"
but no
aws.profile
Legacy migration dropped
awsProfile
when old
awsUseProfile
was absent (#10943).
Upgrade Cline CLI and re-run migration, or reconfigure Bedrock so the profile name is saved.
API-key Bedrock auth not recognized or mixed up with region envOlder auth mapping before API-key alignment (#10731).Upgrade Cline CLI; confirm Cline config uses Bedrock API key auth and still has a region.
ACP/editor integration asks for Cline/ChatGPT auth even though CLI Bedrock worksOlder ACP auth readiness issue (#9404).Upgrade Cline CLI and verify ACP uses the same config directory.
Custom application inference profile ARN cannot be entered/usedOlder CLI model picker limitation (#9244/#9271).Upgrade Cline CLI; use custom/ARN model entry flow if available.
将以下内容作为识别模式,而非代码修改建议:
症状可能原因用户修复方案
AWS region setting is missing. Pass it using the 'region' parameter or the AWS_REGION environment variable.
旧版CLI提供商路径未将Bedrock区域/选项转发至网关(#10770;已通过PR #10807修复,相关PR #10818)。升级Cline CLI。若无法升级,可通过导出
AWS_REGION=<region>
并重新配置Bedrock作为临时解决方案。
配置文件认证显示提供商已配置,但无可用提供商旧版就绪逻辑将Bedrock视为仅支持API密钥认证(#6958)。升级Cline CLI并重新运行Bedrock提供商设置。
AWS credential provider failed: Could not load credentials from any providers
且涉及
credential_process
配置文件名称缺失/未保存、共享配置未加载、
credential_process
配置错误或受CLI版本影响(#10930;PR #10932;旧版迁移PR #10943)。
升级Cline CLI;确保
aws.profile
AWS_PROFILE
指定了配置文件名称;尝试设置
AWS_SDK_LOAD_CONFIG=1
;验证
aws sts get-caller-identity --profile <profile>
迁移后的配置包含
aws.authentication: "profile"
但无
aws.profile
旧版迁移在缺少
awsUseProfile
时丢失了
awsProfile
(#10943)。
升级Cline CLI并重新运行迁移,或重新配置Bedrock以保存配置文件名称。
Bedrock API密钥认证未被识别或与区域环境变量混淆API密钥对齐前的旧版认证映射(#10731)。升级Cline CLI;确认Cline配置使用Bedrock API密钥认证且已设置区域。
ACP/编辑器集成要求Cline/ChatGPT认证,但CLI Bedrock可正常工作旧版ACP认证就绪问题(#9404)。升级Cline CLI并验证ACP使用相同的配置目录。
无法输入/使用自定义应用推理配置文件ARN旧版CLI模型选择器限制(#9244/#9271)。升级Cline CLI;若可用,使用自定义/ARN模型输入流程。

Safe diagnostics workflow

安全诊断流程

1. Establish versions and config location

1. 确认版本及配置位置

Run safe read-only commands:
sh
cline --version 2>/dev/null || npx cline --version 2>/dev/null || true
node --version 2>/dev/null || true
aws --version 2>/dev/null || true
pwd
Ask whether the user runs Cline with
--config <dir>
. If yes, inspect that config directory; otherwise inspect
~/.cline/data
.
运行只读安全命令:
sh
cline --version 2>/dev/null || npx cline --version 2>/dev/null || true
node --version 2>/dev/null || true
aws --version 2>/dev/null || true
pwd
询问用户是否使用
--config <dir>
运行Cline。若是,则检查该配置目录;否则检查
~/.cline/data

2. Inspect Cline provider config with redaction

2. 编辑后查看Cline提供商配置

Never print raw provider/secrets files. Prefer
jq
; otherwise use Node.
sh
CLINE_DATA_DIR="${CLINE_DATA_DIR:-$HOME/.cline/data}"
PROVIDERS="$CLINE_DATA_DIR/settings/providers.json"

if [ -f "$PROVIDERS" ] && command -v jq >/dev/null 2>&1; then
  jq '
    def redact:
      if type == "object" then
        with_entries(if (.key|test("(?i)(key|secret|token|password|credential)")) then .value="<redacted>" else .value=(.value|redact) end)
      elif type == "array" then map(redact)
      else . end;
    .providers.bedrock.settings? | redact
  ' "$PROVIDERS"
elif [ -f "$PROVIDERS" ]; then
  node -e '
    const fs=require("fs"); const p=process.argv[1];
    const v=JSON.parse(fs.readFileSync(p,"utf8"));
    const r=(x)=>Array.isArray(x)?x.map(r):x&&typeof x==="object"?Object.fromEntries(Object.entries(x).map(([k,v])=>[k,/(key|secret|token|password|credential)/i.test(k)?"<redacted>":r(v)])):x;
    console.log(JSON.stringify(r(v.providers?.bedrock?.settings), null, 2));
  ' "$PROVIDERS"
else
  echo "No providers.json at $PROVIDERS"
fi
Interpretation:
  • provider
    should be
    bedrock
    .
  • model
    should be present.
  • aws.region
    or top-level
    region
    should be present unless
    AWS_REGION
    /
    AWS_DEFAULT_REGION
    supplies it.
  • If
    aws.authentication
    is
    profile
    but there is no
    aws.profile
    and no
    AWS_PROFILE
    , Cline will probably use the default AWS SDK credential chain. This is not a failure mode by itself. Treat it as healthy if the default-chain AWS identity and Bedrock checks succeed.
  • If
    aws.authentication
    is
    iam
    , Cline is likely using the default AWS SDK chain.
  • If
    apiKey
    is present or
    aws.authentication
    is
    api-key
    , this is Bedrock API key auth; AWS IAM profile checks may not apply, but region still does.
Also inspect legacy files only with redaction/key-presence checks if migration is suspected:
sh
LEGACY="$CLINE_DATA_DIR/globalState.json"
SECRETS="$CLINE_DATA_DIR/secrets.json"
[ -f "$LEGACY" ] && jq '{awsRegion, awsAuthentication, awsUseProfile, awsProfile, awsUseCrossRegionInference, awsUseGlobalInference, awsBedrockUsePromptCache}' "$LEGACY" 2>/dev/null || true
[ -f "$SECRETS" ] && jq 'keys | map(select(test("(?i)(aws|bedrock)")))' "$SECRETS" 2>/dev/null || true
Do not print values from
secrets.json
.
切勿打印原始提供商/密钥文件。优先使用
jq
;否则使用Node。
sh
CLINE_DATA_DIR="${CLINE_DATA_DIR:-$HOME/.cline/data}"
PROVIDERS="$CLINE_DATA_DIR/settings/providers.json"

if [ -f "$PROVIDERS" ] && command -v jq >/dev/null 2>&1; then
  jq '
    def redact:
      if type == "object" then
        with_entries(if (.key|test("(?i)(key|secret|token|password|credential)")) then .value="<redacted>" else .value=(.value|redact) end)
      elif type == "array" then map(redact)
      else . end;
    .providers.bedrock.settings? | redact
  ' "$PROVIDERS"
elif [ -f "$PROVIDERS" ]; then
  node -e '
    const fs=require("fs"); const p=process.argv[1];
    const v=JSON.parse(fs.readFileSync(p,"utf8"));
    const r=(x)=>Array.isArray(x)?x.map(r):x&&typeof x==="object"?Object.fromEntries(Object.entries(x).map(([k,v])=>[k,/(key|secret|token|password|credential)/i.test(k)?"<redacted>":r(v)])):x;
    console.log(JSON.stringify(r(v.providers?.bedrock?.settings), null, 2));
  ' "$PROVIDERS"
else
  echo "No providers.json at $PROVIDERS"
fi
解读:
  • provider
    应为
    bedrock
  • model
    应存在。
  • aws.region
    或顶层
    region
    应存在,除非
    AWS_REGION
    /
    AWS_DEFAULT_REGION
    已提供区域信息。
  • aws.authentication
    profile
    但无
    aws.profile
    且未设置
    AWS_PROFILE
    ,Cline可能会使用默认AWS SDK凭证链。这本身不属于故障模式。 若默认链的AWS身份及Bedrock检查通过,则视为正常。
  • aws.authentication
    iam
    ,Cline可能使用默认AWS SDK链。
  • 若存在
    apiKey
    aws.authentication
    api-key
    ,则为Bedrock API密钥认证;AWS IAM配置文件检查可能不适用,但区域仍需验证。
若怀疑存在迁移问题,也可仅通过编辑/密钥存在检查查看旧版文件:
sh
LEGACY="$CLINE_DATA_DIR/globalState.json"
SECRETS="$CLINE_DATA_DIR/secrets.json"
[ -f "$LEGACY" ] && jq '{awsRegion, awsAuthentication, awsUseProfile, awsProfile, awsUseCrossRegionInference, awsUseGlobalInference, awsBedrockUsePromptCache}' "$LEGACY" 2>/dev/null || true
[ -f "$SECRETS" ] && jq 'keys | map(select(test("(?i)(aws|bedrock)")))' "$SECRETS" 2>/dev/null || true
请勿打印
secrets.json
中的值。

3. Inspect AWS environment safely

3. 安全查看AWS环境

Environment credentials can override profile/default-chain behavior. Print presence, not credential values:
sh
python3 - <<'PY'
import os, re
safe = ["AWS_PROFILE","AWS_REGION","AWS_DEFAULT_REGION","AWS_CONFIG_FILE","AWS_SHARED_CREDENTIALS_FILE","AWS_SDK_LOAD_CONFIG"]
secretish = ["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN","AWS_SECURITY_TOKEN"]
for k in safe:
    if k in os.environ:
        print(f"{k}={os.environ[k]}")
for k in secretish:
    if k in os.environ:
        print(f"{k}=<set redacted>")
for k in ["AWS_ROLE_ARN","AWS_WEB_IDENTITY_TOKEN_FILE","AWS_CONTAINER_CREDENTIALS_RELATIVE_URI","AWS_CONTAINER_CREDENTIALS_FULL_URI"]:
    if k in os.environ:
        v = os.environ[k]
        if k == "AWS_ROLE_ARN": v = re.sub(r"arn:aws[a-z-]*:iam::\d{12}:", "arn:aws:iam::<account>:", v)
        print(f"{k}={v}")
PY
Flag these issues:
  • AWS_ACCESS_KEY_ID
    /
    AWS_SECRET_ACCESS_KEY
    are set unexpectedly: they can take precedence over profiles and point Cline at the wrong account.
  • AWS_PROFILE
    differs from Cline
    aws.profile
    : Cline should use the saved profile when present; otherwise environment/default chain may be used. Only treat this as a likely issue if the resolved identity/account/region is demonstrably wrong for the intended Bedrock access.
  • No region in Cline config or env: Bedrock calls will fail.
  • Temporary env keys are set without
    AWS_SESSION_TOKEN
    : STS-derived credentials will fail.
环境凭证可能覆盖配置文件/默认链行为。仅打印凭证是否存在,不显示凭证值:
sh
python3 - <<'PY'
import os, re
safe = ["AWS_PROFILE","AWS_REGION","AWS_DEFAULT_REGION","AWS_CONFIG_FILE","AWS_SHARED_CREDENTIALS_FILE","AWS_SDK_LOAD_CONFIG"]
secretish = ["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN","AWS_SECURITY_TOKEN"]
for k in safe:
    if k in os.environ:
        print(f"{k}={os.environ[k]}")
for k in secretish:
    if k in os.environ:
        print(f"{k}=<set redacted>")
for k in ["AWS_ROLE_ARN","AWS_WEB_IDENTITY_TOKEN_FILE","AWS_CONTAINER_CREDENTIALS_RELATIVE_URI","AWS_CONTAINER_CREDENTIALS_FULL_URI"]:
    if k in os.environ:
        v = os.environ[k]
        if k == "AWS_ROLE_ARN": v = re.sub(r"arn:aws[a-z-]*:iam::\d{12}:", "arn:aws:iam::<account>:", v)
        print(f"{k}={v}")
PY
标记以下问题:
  • AWS_ACCESS_KEY_ID
    /
    AWS_SECRET_ACCESS_KEY
    被意外设置:它们优先级高于配置文件,可能导致Cline指向错误账户。
  • AWS_PROFILE
    与Cline的
    aws.profile
    不一致:当Cline保存了配置文件时应使用该配置文件;否则可能使用环境/默认链。仅当解析后的身份/账户/区域明显不符合Bedrock访问需求时,才视为问题。
  • Cline配置或环境中无区域信息:Bedrock调用会失败。
  • 设置了临时环境密钥但无
    AWS_SESSION_TOKEN
    :STS派生的凭证会失效。

4. Inspect AWS config/credentials files without secrets

4. 查看AWS配置/凭证文件(不含密钥)

List profile sections and non-secret key names. Do not print access key values.
sh
AWS_CONFIG_FILE="${AWS_CONFIG_FILE:-$HOME/.aws/config}"
AWS_SHARED_CREDENTIALS_FILE="${AWS_SHARED_CREDENTIALS_FILE:-$HOME/.aws/credentials}"

for f in "$AWS_CONFIG_FILE" "$AWS_SHARED_CREDENTIALS_FILE"; do
  echo "--- $f ---"
  [ -f "$f" ] || { echo "missing"; continue; }
  awk '
    /^\[/ { section=$0; print section; next }
    /^[[:space:]]*(aws_access_key_id|aws_secret_access_key|aws_session_token)[[:space:]]*=/ { print "  " $1 "=<redacted>"; next }
    /^[[:space:]]*(region|sso_session|sso_start_url|sso_region|sso_account_id|sso_role_name|role_arn|source_profile|credential_source|web_identity_token_file|credential_process)[[:space:]]*=/ {
      key=$1; sub(/[[:space:]]*=.*/, "", key)
      if (key ~ /role_arn/) print "  " key "=<present redacted>";
      else if (key ~ /credential_process/) print "  " key "=<present redacted>";
      else print "  " $0
    }
  ' "$f"
done
Interpretation:
  • In
    ~/.aws/config
    , named profiles are
    [profile name]
    ; in
    ~/.aws/credentials
    , they are
    [name]
    .
  • A profile with
    credential_process
    should work through the AWS SDK chain in fixed CLI builds, but it must be the active profile.
  • SSO profiles require a valid cached login: run
    aws sso login --profile <profile>
    as the user if expired.
  • Assume-role profiles require the source profile or credential source to be valid.
列出配置文件章节及非密钥项名称。请勿打印访问密钥值。
sh
AWS_CONFIG_FILE="${AWS_CONFIG_FILE:-$HOME/.aws/config}"
AWS_SHARED_CREDENTIALS_FILE="${AWS_SHARED_CREDENTIALS_FILE:-$HOME/.aws/credentials}"

for f in "$AWS_CONFIG_FILE" "$AWS_SHARED_CREDENTIALS_FILE"; do
  echo "--- $f ---"
  [ -f "$f" ] || { echo "missing"; continue; }
  awk '
    /^\[/ { section=$0; print section; next }
    /^[[:space:]]*(aws_access_key_id|aws_secret_access_key|aws_session_token)[[:space:]]*=/ { print "  " $1 "=<redacted>"; next }
    /^[[:space:]]*(region|sso_session|sso_start_url|sso_region|sso_account_id|sso_role_name|role_arn|source_profile|credential_source|web_identity_token_file|credential_process)[[:space:]]*=/ {
      key=$1; sub(/[[:space:]]*=.*/, "", key)
      if (key ~ /role_arn/) print "  " key "=<present redacted>";
      else if (key ~ /credential_process/) print "  " key "=<present redacted>";
      else print "  " $0
    }
  ' "$f"
done
解读:
  • ~/.aws/config
    中,命名配置文件格式为
    [profile name]
    ;在
    ~/.aws/credentials
    中,格式为
    [name]
  • 包含
    credential_process
    的配置文件在修复后的CLI版本中可通过AWS SDK链正常工作,但必须是活跃配置文件。
  • SSO配置文件需要有效的缓存登录:若过期,用户需运行
    aws sso login --profile <profile>
  • 角色切换配置文件要求源配置文件或凭证源有效。

5. Validate AWS identity without exposing credentials

5. 验证AWS身份(不暴露凭证)

Use the likely profile and region. If no profile is configured, omit
--profile
to test the default chain.
sh
PROFILE_ARG="--profile <profile>"   # replace or leave empty for default chain
REGION_ARG="--region <region>"      # replace with Cline/AWS region

aws sts get-caller-identity $PROFILE_ARG --output json
aws configure list $PROFILE_ARG
get-caller-identity
does not reveal secret credentials, but account IDs/role names can be sensitive. Redact them in the final report unless the user already shared them.
Evaluation rules:
  • If Cline is using the default credential chain and
    aws sts get-caller-identity
    succeeds without
    --profile
    , that auth path looks good unless there is direct evidence that Cline runs in a different environment.
  • If
    aws configure list
    reports credential source/type as
    login
    and STS plus Bedrock list/get model calls succeed, treat the AWS CLI login/default-chain path as working. Do not claim Cline cannot use it unless there is an actual Cline error or version-specific evidence.
  • A missing saved
    aws.profile
    is only a problem when the user intended a specific non-default profile and the default-chain identity is wrong or cannot access Bedrock.
  • Absence of
    ~/.aws/credentials
    , SSO fields,
    credential_process
    , or
    AWS_PROFILE
    is not a problem when another default-chain source resolves successfully.
Fix guidance by failure:
  • SSO token expired:
    aws sso login --profile <profile>
    .
  • Process provider failed: confirm the profile selected by Cline is the one with
    credential_process
    ; test
    aws sts get-caller-identity --profile <profile>
    ; ensure the process is executable and returns AWS process-credential JSON.
  • Cannot find profile: set/reconfigure Cline
    aws.profile
    , export
    AWS_PROFILE
    , or fix section names in AWS files.
  • Env keys point to wrong account: unset them or launch Cline from a shell with the intended env.
使用可能的配置文件和区域。若未配置配置文件,省略
--profile
以测试默认链。
sh
PROFILE_ARG="--profile <profile>"   # 替换为实际配置文件,或留空使用默认链
REGION_ARG="--region <region>"      # 替换为Cline/AWS区域

aws sts get-caller-identity $PROFILE_ARG --output json
aws configure list $PROFILE_ARG
get-caller-identity
不会泄露密钥凭证,但账户ID/角色名称可能敏感。除非用户已共享,否则在最终报告中编辑这些信息。
评估规则:
  • 若Cline使用默认凭证链,且
    aws sts get-caller-identity
    在无
    --profile
    时成功,则该认证路径正常,除非有直接证据表明Cline运行环境不同。
  • aws configure list
    显示凭证源/类型为
    login
    ,且STS及Bedrock列表/获取模型调用成功,则认为AWS CLI登录/默认链路径正常。除非有实际Cline错误或版本特定证据,否则不要声称Cline无法使用该路径。
  • 仅当用户打算使用特定非默认配置文件且默认链身份错误或无法访问Bedrock时,缺失保存的
    aws.profile
    才视为问题。
  • 当其他默认链源可成功解析时,
    ~/.aws/credentials
    、SSO字段、
    credential_process
    AWS_PROFILE
    缺失并非问题。
按故障类型提供修复指导:
  • SSO令牌过期:
    aws sso login --profile <profile>
  • 流程提供商失败:确认Cline选择的配置文件包含
    credential_process
    ;测试
    aws sts get-caller-identity --profile <profile>
    ;确保流程可执行并返回AWS流程凭证JSON。
  • 找不到配置文件:设置/重新配置Cline的
    aws.profile
    、导出
    AWS_PROFILE
    或修复AWS文件中的章节名称。
  • 环境密钥指向错误账户:取消设置或从包含目标环境的Shell启动Cline。

6. Validate Bedrock region/model access without invoking a model

6. 验证Bedrock区域/模型访问权限(不调用模型)

sh
aws bedrock list-foundation-models $PROFILE_ARG $REGION_ARG --by-output-modality TEXT --output table
If the selected model is known, also check availability where supported:
sh
aws bedrock get-foundation-model $PROFILE_ARG $REGION_ARG --model-identifier '<model-id>' --output json
Troubleshoot results:
  • AccessDeniedException
    : identity lacks
    bedrock:InvokeModel
    ,
    bedrock:InvokeModelWithResponseStream
    , list/get model permissions, Marketplace/model access permissions, or an SCP/permission boundary denies access.
  • Model absent in region: choose a model/inference profile available in that region, change region, or use a valid cross-region/global inference profile.
  • Anthropic first-time access: complete Bedrock model access / use-case form in the AWS account/organization. Marketplace permissions may be required for first-time enablement.
  • GovCloud: third-party model access may need enablement in both linked commercial and GovCloud accounts; model availability differs by GovCloud region.
  • Custom/application inference profile ARN: confirm the ARN region/account match the configured region/profile account and the identity can use that inference profile.
sh
aws bedrock list-foundation-models $PROFILE_ARG $REGION_ARG --by-output-modality TEXT --output table
若已知所选模型,还可在支持的区域检查可用性:
sh
aws bedrock get-foundation-model $PROFILE_ARG $REGION_ARG --model-identifier '<model-id>' --output json
排查结果:
  • AccessDeniedException
    :身份缺少
    bedrock:InvokeModel
    bedrock:InvokeModelWithResponseStream
    、列表/获取模型权限、Marketplace/模型访问权限,或SCP/权限边界拒绝访问。
  • 模型在该区域不可用:选择该区域可用的模型/推理配置文件、更改区域,或使用有效的跨区域/全局推理配置文件。
  • Anthropic首次访问:在AWS账户/组织中完成Bedrock模型访问/用例表单。首次启用可能需要Marketplace权限。
  • GovCloud:第三方模型访问可能需要在关联的商业账户和GovCloud账户中均启用;模型可用性因GovCloud区域而异。
  • 自定义/应用推理配置文件ARN:确认ARN的区域/账户与配置的区域/配置文件账户匹配,且身份可使用该推理配置文件。

7. Rule out Bedrock errors that are not auth problems

7. 排除非认证类Bedrock错误

If STS identity and Bedrock model listing work, do not force an auth diagnosis. Some Bedrock failures are request/history/model issues:
  • Invalid type for parameter ... image.source.bytes
    or screenshot/history replay failures: likely Bedrock image bytes serialization, not auth (#10926 / PR #10928). Suggest upgrading Cline CLI and retrying a fresh task without replayed screenshot history.
  • Context-window or token-limit errors that arrive as plain text: likely context overflow, not auth (#10838). Suggest compacting/starting a fresh task or upgrading Cline CLI for improved detection.
  • ValidationException
    for a model ID/ARN: often wrong region, unsupported model ID, missing inference profile, or using an application inference profile ARN with the wrong account/region.
  • Errors only after several successful turns usually indicate request content, history, model availability, quota, or context issues rather than credential resolution.
若STS身份及Bedrock模型列表正常,请勿强行进行认证诊断。部分Bedrock故障属于请求/历史/模型问题:
  • Invalid type for parameter ... image.source.bytes
    或截图/历史重放失败:可能是Bedrock图片字节序列化问题,而非认证问题(#10926 / PR #10928)。建议升级Cline CLI并重新发起无截图历史的新任务。
  • 纯文本形式的上下文窗口或令牌限制错误:可能是上下文溢出,而非认证问题(#10838)。建议压缩/发起新任务,或升级Cline CLI以提升检测能力。
  • 模型ID/ARN的
    ValidationException
    :通常是区域错误、模型ID不支持、推理配置文件缺失,或使用了账户/区域不匹配的应用推理配置文件ARN。
  • 多次成功交互后才出现的错误:通常表明请求内容、历史、模型可用性、配额或上下文存在问题,而非凭证解析问题。

Final report format

最终报告格式

Use one of two output modes.
使用以下两种输出模式之一。

Normal mode (default)

普通模式(默认)

By default, keep the final answer concise and report only:
  1. Recommended user fixes or next checks: commands or UI actions. Do not suggest Cline code changes. If everything looks good, recommend no changes or only optional next checks.
  2. Diagnosis: one of exactly these two outcomes:
    • Likely issue found: concise bullets with evidence and severity. Use this only for issues likely to break Cline, such as missing region, failed STS/default-chain resolution, wrong account/identity, expired SSO, failed
      credential_process
      , denied Bedrock access, unavailable selected model/region, or a known affected Cline version paired with the matching symptom.
    • Looks good: explicitly say the checked configuration/auth path looks good and no likely cause was found. Optionally include a short Low-probability observations addition for minor or theoretical findings that are unlikely to be causing the user's current issue.
The Diagnosis must be the last section in the report. In the diagnosis text, tell the user to scroll up for remediation steps or optional next checks.
At the end of normal-mode output, tell the user they can ask for deeper debugging information by saying something like:
Show me Dr. Bedrock's deep debugging details
or
Run Dr. Bedrock in verbose mode
.
默认情况下,保持最终答案简洁,仅报告:
  1. 推荐用户修复方案或下一步检查:命令或UI操作。请勿建议修改Cline代码。若一切正常,建议无需更改或仅进行可选的下一步检查。
  2. 诊断结果:以下两种结果之一:
    • 发现可能问题:简明列出证据及严重程度。仅用于可能导致Cline故障的问题,如区域缺失、STS/默认链解析失败、账户/身份错误、SSO过期、
      credential_process
      失效、Bedrock访问被拒绝、所选模型/区域不可用,或已知受影响的Cline版本匹配对应症状。
    • 一切正常:明确说明已检查的配置/认证路径正常,未发现可能原因。可选择性添加低概率观察部分,列出与当前用户问题关联性弱或可能性低的次要/理论发现。
诊断结果必须是报告的最后一部分。在诊断文本中,告知用户向上滚动查看修复步骤或可选的下一步检查。
普通模式输出末尾,告知用户可通过类似以下请求获取更深入的调试信息:
Show me Dr. Bedrock's deep debugging details
Run Dr. Bedrock in verbose mode

Verbose / deep debugging mode

详细/深度调试模式

If the user asks for more information, verbose output, deep debugging details, or asks to see how Dr. Bedrock reached the conclusion, include sections 1–4 before the normal-mode sections:
  1. Likely auth scheme: API key, direct IAM keys, named profile, default chain, SSO, credential_process, assume role, web identity, ECS/EC2.
  2. Cline CLI config status: provider/model/region present, auth fields present, profile saved or missing, likely affected by known CLI version issues.
  3. AWS local auth status: env precedence, profile/default-chain health, STS identity test result (redacted).
  4. Bedrock access status: region, model availability, permissions/model-access concerns.
  5. Recommended user fixes or next checks: same as normal mode.
  6. Diagnosis: same as normal mode and still the final section.
Do not invent an issue just to have one. If the config is coherent, AWS identity resolves, region is set, and Bedrock model/list checks pass, conclude Looks good. If something is merely different from a named-profile setup but still resolves through the default credential chain, do not call it a problem. If you noticed possible concerns that are weakly related or unlikely, include them only as optional Low-probability observations within the Looks good diagnosis rather than presenting them as root causes.
若用户要求更多信息、详细输出、深度调试细节或询问Bedrock博士的结论依据,需在普通模式章节前添加以下1-4节:
  1. 可能的认证方案:API密钥、直接IAM密钥、命名配置文件、默认链、SSO、credential_process、角色切换、Web身份、ECS/EC2。
  2. Cline CLI配置状态:提供商/模型/区域是否存在、认证字段是否存在、配置文件是否保存或缺失、是否受已知CLI版本问题影响。
  3. AWS本地认证状态:环境优先级、配置文件/默认链健康状况、STS身份测试结果(已编辑)。
  4. Bedrock访问状态:区域、模型可用性、权限/模型访问问题。
  5. 推荐用户修复方案或下一步检查:与普通模式相同。
  6. 诊断结果:与普通模式相同,且仍为最后一部分。
请勿为了凑问题而编造问题。若配置一致、AWS身份解析正常、区域已设置且Bedrock模型/列表检查通过,则结论为一切正常。若某些内容与命名配置文件设置不同但仍可通过默认凭证链解析,请勿视为问题。若发现可能存在但关联性弱或可能性低的问题,仅在一切正常诊断结果中作为可选的低概率观察列出,而非作为根本原因。

Common fix snippets

常见修复代码片段

  • Upgrade Cline CLI:
    sh
    npm install -g cline@latest
    cline --version
  • Launch with explicit profile/region:
    sh
    AWS_PROFILE=<profile> AWS_REGION=<region> AWS_SDK_LOAD_CONFIG=1 cline
  • Refresh SSO:
    sh
    aws sso login --profile <profile>
    aws sts get-caller-identity --profile <profile>
  • Reconfigure Bedrock in Cline CLI if saved profile/region is missing:
    sh
    cline auth
    Choose AWS Bedrock, leave API key blank for profile/default-chain auth, enter region, and enter the AWS profile name when prompted.
  • 升级Cline CLI:
    sh
    npm install -g cline@latest
    cline --version
  • 使用明确的配置文件/区域启动:
    sh
    AWS_PROFILE=<profile> AWS_REGION=<region> AWS_SDK_LOAD_CONFIG=1 cline
  • 刷新SSO:
    sh
    aws sso login --profile <profile>
    aws sts get-caller-identity --profile <profile>
  • 若保存的配置文件/区域缺失,重新配置Cline CLI中的Bedrock:
    sh
    cline auth
    选择AWS Bedrock,留空API密钥以使用配置文件/默认链认证,输入区域,并在提示时输入AWS配置文件名称。