Skip to content

fix(gateway): say a refusal without an exception name in its own sentence - #231

Merged
fylorn merged 1 commit into
mainfrom
fix/bedrock-refusal-wording
Sep 28, 2026
Merged

fylorn merged 1 commit into
mainfrom
fix/bedrock-refusal-wording

Conversation

@fylorn

@fylorn fylorn commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

When AWS refuses a Bedrock credential without naming the exception (no x-amzn-ErrorType, no __type in the body), gw.upstream.bedrock_refused filled the English phrase no exception name into its {kind} argument. A translated interface then shows an untranslated fragment inside its sentence, which breaks the rule that a message code is one sentence and never a template filled with English words.

That case now has its own code and sentence, gw.upstream.bedrock_refused_unnamed (… (HTTP {status}). Check that the credential is valid …). The named case is unchanged.

Verification: cargo fmt --check and cargo clippy -p tw-gateway --all-targets -D warnings are clean, and tests/bedrock.rs passes (13 tests). The new end-to-end test sends a 403 without an exception name and checks the sentence, and that the account ID stays out. msg-codes.txt is regenerated.

🤖 Generated with Claude Code

…ence

When AWS refused a Bedrock credential without naming the exception, the
refusal filled the English phrase "no exception name" into the `{kind}`
slot of `gw.upstream.bedrock_refused`, so a translated interface showed
an untranslated fragment. That case now has its own code and sentence,
`gw.upstream.bedrock_refused_unnamed`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fylorn
fylorn merged commit 4382419 into main Sep 28, 2026
4 checks passed
@fylorn
fylorn deleted the fix/bedrock-refusal-wording branch September 28, 2026 18:25
@fylorn fylorn mentioned this pull request Sep 28, 2026
fylorn added a commit that referenced this pull request Sep 29, 2026
Minor release for #223, #224, #226, #227, #228, #229, #230 and #231,
and #222 before them.

- Bump the workspace version to 0.55.0
- release-notes/0.55.0.md

Control-plane protocol 28 (was 27): the protocol `bedrock`,
ProviderInput.aws / ProviderView.aws (AwsKeys), ProviderView.region,
ProviderPreview.region and AttemptView.model. The request store schema is
unchanged (22), so the request history is kept.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant