dr-bedrock
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDr. 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:
- Bedrock API key: Cline config has or
apiKey.aws.authentication: "api-key" - Direct IAM keys in Cline config: +
aws.accessKey, optionalaws.secretKey.aws.sessionToken - Named AWS profile: and
aws.authentication: "profile", oraws.profile.AWS_PROFILE - Default AWS provider chain: or profile auth with no saved profile name.
aws.authentication: "iam" - AWS IAM Identity Center / SSO: profile contains ,
sso_session,sso_start_url, orsso_account_id.sso_role_name - credential_process: profile contains .
credential_process - Assume role profile: profile contains with
role_arn,source_profile, or web identity.credential_source - Web identity / OIDC: +
AWS_ROLE_ARNor profile web identity settings.AWS_WEB_IDENTITY_TOKEN_FILE - ECS/EC2 metadata: container metadata env vars or IMDS on EC2.
先判断可能的认证方案,再验证区域、凭证、Cline配置及Bedrock模型访问权限。
需考虑的认证方案:
- Bedrock API密钥:Cline配置中包含或
apiKey。aws.authentication: "api-key" - Cline配置中的直接IAM密钥:+
aws.accessKey,可选aws.secretKey。aws.sessionToken - 命名AWS配置文件:且
aws.authentication: "profile"存在,或设置了aws.profile。AWS_PROFILE - 默认AWS提供商链:,或未保存配置文件名称的配置文件认证。
aws.authentication: "iam" - AWS IAM身份中心/SSO:配置文件包含、
sso_session、sso_start_url或sso_account_id。sso_role_name - credential_process:配置文件包含。
credential_process - 角色切换配置文件:配置文件包含及
role_arn、source_profile或Web身份信息。credential_source - Web身份/OIDC:设置了+
AWS_ROLE_ARN,或配置文件中有Web身份设置。AWS_WEB_IDENTITY_TOKEN_FILE - ECS/EC2元数据:容器元数据环境变量或EC2上的IMDS。
Known Cline CLI Bedrock failure modes
已知Cline CLI Bedrock故障模式
Use these as recognition patterns, not as code-change recommendations:
| Symptom | Likely cause | User-facing fix |
|---|---|---|
| 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 |
| Profile auth says provider configured, then no provider is ready | Older readiness logic treated Bedrock like API-key-only (#6958). | Upgrade Cline CLI and re-run Bedrock provider setup. |
| Missing/unsaved profile name, shared config not loaded, bad | Upgrade Cline CLI; ensure |
Migrated config has | Legacy migration dropped | 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 env | Older 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 works | Older ACP auth readiness issue (#9404). | Upgrade Cline CLI and verify ACP uses the same config directory. |
| Custom application inference profile ARN cannot be entered/used | Older CLI model picker limitation (#9244/#9271). | Upgrade Cline CLI; use custom/ARN model entry flow if available. |
将以下内容作为识别模式,而非代码修改建议:
| 症状 | 可能原因 | 用户修复方案 |
|---|---|---|
| 旧版CLI提供商路径未将Bedrock区域/选项转发至网关(#10770;已通过PR #10807修复,相关PR #10818)。 | 升级Cline CLI。若无法升级,可通过导出 |
| 配置文件认证显示提供商已配置,但无可用提供商 | 旧版就绪逻辑将Bedrock视为仅支持API密钥认证(#6958)。 | 升级Cline CLI并重新运行Bedrock提供商设置。 |
| 配置文件名称缺失/未保存、共享配置未加载、 | 升级Cline CLI;确保 |
迁移后的配置包含 | 旧版迁移在缺少 | 升级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
pwdAsk whether the user runs Cline with . If yes, inspect that config directory; otherwise inspect .
--config <dir>~/.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询问用户是否使用运行Cline。若是,则检查该配置目录;否则检查。
--config <dir>~/.cline/data2. Inspect Cline provider config with redaction
2. 编辑后查看Cline提供商配置
Never print raw provider/secrets files. Prefer ; otherwise use Node.
jqsh
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"
fiInterpretation:
- should be
provider.bedrock - should be present.
model - or top-level
aws.regionshould be present unlessregion/AWS_REGIONsupplies it.AWS_DEFAULT_REGION - If is
aws.authenticationbut there is noprofileand noaws.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.AWS_PROFILE - If is
aws.authentication, Cline is likely using the default AWS SDK chain.iam - If is present or
apiKeyisaws.authentication, this is Bedrock API key auth; AWS IAM profile checks may not apply, but region still does.api-key
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 || trueDo not print values from .
secrets.json切勿打印原始提供商/密钥文件。优先使用;否则使用Node。
jqsh
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,Cline可能会使用默认AWS SDK凭证链。这本身不属于故障模式。 若默认链的AWS身份及Bedrock检查通过,则视为正常。AWS_PROFILE - 若为
aws.authentication,Cline可能使用默认AWS SDK链。iam - 若存在或
apiKey为aws.authentication,则为Bedrock API密钥认证;AWS IAM配置文件检查可能不适用,但区域仍需验证。api-key
若怀疑存在迁移问题,也可仅通过编辑/密钥存在检查查看旧版文件:
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.json3. 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}")
PYFlag these issues:
- /
AWS_ACCESS_KEY_IDare set unexpectedly: they can take precedence over profiles and point Cline at the wrong account.AWS_SECRET_ACCESS_KEY - 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.aws.profile - No region in Cline config or env: Bedrock calls will fail.
- Temporary env keys are set without : STS-derived credentials will fail.
AWS_SESSION_TOKEN
环境凭证可能覆盖配置文件/默认链行为。仅打印凭证是否存在,不显示凭证值:
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被意外设置:它们优先级高于配置文件,可能导致Cline指向错误账户。AWS_SECRET_ACCESS_KEY - 与Cline的
AWS_PROFILE不一致:当Cline保存了配置文件时应使用该配置文件;否则可能使用环境/默认链。仅当解析后的身份/账户/区域明显不符合Bedrock访问需求时,才视为问题。aws.profile - Cline配置或环境中无区域信息:Bedrock调用会失败。
- 设置了临时环境密钥但无:STS派生的凭证会失效。
AWS_SESSION_TOKEN
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"
doneInterpretation:
- In , named profiles are
~/.aws/config; in[profile name], they are~/.aws/credentials.[name] - A profile with should work through the AWS SDK chain in fixed CLI builds, but it must be the active profile.
credential_process - SSO profiles require a valid cached login: run as the user if expired.
aws sso login --profile <profile> - 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] - 包含的配置文件在修复后的CLI版本中可通过AWS SDK链正常工作,但必须是活跃配置文件。
credential_process - 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 to test the default chain.
--profilesh
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_ARGget-caller-identityEvaluation rules:
- If Cline is using the default credential chain and succeeds without
aws sts get-caller-identity, that auth path looks good unless there is direct evidence that Cline runs in a different environment.--profile - If reports credential source/type as
aws configure listand 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.login - A missing saved is only a problem when the user intended a specific non-default profile and the default-chain identity is wrong or cannot access Bedrock.
aws.profile - Absence of , SSO fields,
~/.aws/credentials, orcredential_processis not a problem when another default-chain source resolves successfully.AWS_PROFILE
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 ; test
credential_process; ensure the process is executable and returns AWS process-credential JSON.aws sts get-caller-identity --profile <profile> - Cannot find profile: set/reconfigure Cline , export
aws.profile, or fix section names in AWS files.AWS_PROFILE - Env keys point to wrong account: unset them or launch Cline from a shell with the intended env.
使用可能的配置文件和区域。若未配置配置文件,省略以测试默认链。
--profilesh
PROFILE_ARG="--profile <profile>" # 替换为实际配置文件,或留空使用默认链
REGION_ARG="--region <region>" # 替换为Cline/AWS区域
aws sts get-caller-identity $PROFILE_ARG --output json
aws configure list $PROFILE_ARGget-caller-identity评估规则:
- 若Cline使用默认凭证链,且在无
aws sts get-caller-identity时成功,则该认证路径正常,除非有直接证据表明Cline运行环境不同。--profile - 若显示凭证源/类型为
aws configure list,且STS及Bedrock列表/获取模型调用成功,则认为AWS CLI登录/默认链路径正常。除非有实际Cline错误或版本特定证据,否则不要声称Cline无法使用该路径。login - 仅当用户打算使用特定非默认配置文件且默认链身份错误或无法访问Bedrock时,缺失保存的才视为问题。
aws.profile - 当其他默认链源可成功解析时,、SSO字段、
~/.aws/credentials或credential_process缺失并非问题。AWS_PROFILE
按故障类型提供修复指导:
- SSO令牌过期:。
aws sso login --profile <profile> - 流程提供商失败:确认Cline选择的配置文件包含;测试
credential_process;确保流程可执行并返回AWS流程凭证JSON。aws sts get-caller-identity --profile <profile> - 找不到配置文件:设置/重新配置Cline的、导出
aws.profile或修复AWS文件中的章节名称。AWS_PROFILE - 环境密钥指向错误账户:取消设置或从包含目标环境的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 tableIf 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 jsonTroubleshoot results:
- : identity lacks
AccessDeniedException,bedrock:InvokeModel, list/get model permissions, Marketplace/model access permissions, or an SCP/permission boundary denies access.bedrock:InvokeModelWithResponseStream - 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、列表/获取模型权限、Marketplace/模型访问权限,或SCP/权限边界拒绝访问。bedrock:InvokeModelWithResponseStream - 模型在该区域不可用:选择该区域可用的模型/推理配置文件、更改区域,或使用有效的跨区域/全局推理配置文件。
- 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:
- 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.
Invalid type for parameter ... image.source.bytes - 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.
- 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.
ValidationException - Errors only after several successful turns usually indicate request content, history, model availability, quota, or context issues rather than credential resolution.
若STS身份及Bedrock模型列表正常,请勿强行进行认证诊断。部分Bedrock故障属于请求/历史/模型问题:
- 或截图/历史重放失败:可能是Bedrock图片字节序列化问题,而非认证问题(#10926 / PR #10928)。建议升级Cline CLI并重新发起无截图历史的新任务。
Invalid type for parameter ... image.source.bytes - 纯文本形式的上下文窗口或令牌限制错误:可能是上下文溢出,而非认证问题(#10838)。建议压缩/发起新任务,或升级Cline CLI以提升检测能力。
- 模型ID/ARN的:通常是区域错误、模型ID不支持、推理配置文件缺失,或使用了账户/区域不匹配的应用推理配置文件ARN。
ValidationException - 多次成功交互后才出现的错误:通常表明请求内容、历史、模型可用性、配额或上下文存在问题,而非凭证解析问题。
Final report format
最终报告格式
Use one of two output modes.
使用以下两种输出模式之一。
Normal mode (default)
普通模式(默认)
By default, keep the final answer concise and report only:
- 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.
- 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 , denied Bedrock access, unavailable selected model/region, or a known affected Cline version paired with the matching symptom.
credential_process - 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.
- 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
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: or .
Show me Dr. Bedrock's deep debugging detailsRun Dr. Bedrock in verbose mode默认情况下,保持最终答案简洁,仅报告:
- 推荐用户修复方案或下一步检查:命令或UI操作。请勿建议修改Cline代码。若一切正常,建议无需更改或仅进行可选的下一步检查。
- 诊断结果:以下两种结果之一:
- 发现可能问题:简明列出证据及严重程度。仅用于可能导致Cline故障的问题,如区域缺失、STS/默认链解析失败、账户/身份错误、SSO过期、失效、Bedrock访问被拒绝、所选模型/区域不可用,或已知受影响的Cline版本匹配对应症状。
credential_process - 一切正常:明确说明已检查的配置/认证路径正常,未发现可能原因。可选择性添加低概率观察部分,列出与当前用户问题关联性弱或可能性低的次要/理论发现。
- 发现可能问题:简明列出证据及严重程度。仅用于可能导致Cline故障的问题,如区域缺失、STS/默认链解析失败、账户/身份错误、SSO过期、
诊断结果必须是报告的最后一部分。在诊断文本中,告知用户向上滚动查看修复步骤或可选的下一步检查。
普通模式输出末尾,告知用户可通过类似以下请求获取更深入的调试信息: 或 。
Show me Dr. Bedrock's deep debugging detailsRun Dr. Bedrock in verbose modeVerbose / 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:
- Likely auth scheme: API key, direct IAM keys, named profile, default chain, SSO, credential_process, assume role, web identity, ECS/EC2.
- Cline CLI config status: provider/model/region present, auth fields present, profile saved or missing, likely affected by known CLI version issues.
- AWS local auth status: env precedence, profile/default-chain health, STS identity test result (redacted).
- Bedrock access status: region, model availability, permissions/model-access concerns.
- Recommended user fixes or next checks: same as normal mode.
- 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节:
- 可能的认证方案:API密钥、直接IAM密钥、命名配置文件、默认链、SSO、credential_process、角色切换、Web身份、ECS/EC2。
- Cline CLI配置状态:提供商/模型/区域是否存在、认证字段是否存在、配置文件是否保存或缺失、是否受已知CLI版本问题影响。
- AWS本地认证状态:环境优先级、配置文件/默认链健康状况、STS身份测试结果(已编辑)。
- Bedrock访问状态:区域、模型可用性、权限/模型访问问题。
- 推荐用户修复方案或下一步检查:与普通模式相同。
- 诊断结果:与普通模式相同,且仍为最后一部分。
请勿为了凑问题而编造问题。若配置一致、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:
Choose AWS Bedrock, leave API key blank for profile/default-chain auth, enter region, and enter the AWS profile name when prompted.sh
cline auth
- 升级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:
选择AWS Bedrock,留空API密钥以使用配置文件/默认链认证,输入区域,并在提示时输入AWS配置文件名称。sh
cline auth