Skip to content

fix: map documented Bedrock and Anthropic stop reasons - #1051

Open
jaeminbird wants to merge 1 commit into
evalstate:mainfrom
jaeminbird:fix/documented-stop-reasons
Open

jaeminbird wants to merge 1 commit into
evalstate:mainfrom
jaeminbird:fix/documented-stop-reasons

Conversation

@jaeminbird

@jaeminbird jaeminbird commented Oct 30, 2026 •

Copy link
Copy Markdown

Bedrock's guardrail_intervened and content_filtered stops were reported as a normal end of turn (ACP returned end_turn, not a refusal), and model_context_window_exceeded on Bedrock and Anthropic wasn't reported as truncation. The Bedrock map now covers every Converse StopReason: guardrail and filter stops map to SAFETY, the context-window stop to MAX_TOKENS, and malformed_* to ERROR. Anthropic's context-window stop maps to MAX_TOKENS. +57/-2.

The tests are contracts rather than tables: every value in botocore's StopReason enum must map without the "unknown" warning, and no Anthropic BetaStopReason except end_turn/tool_use may come out as END_TURN. They fail on main (9) and pass on the branch; format and lint pass, and type checking and the unit suite show the same Windows-only failures as main. Not run: Linux, the integration tests.

A calfskin wallet is a thoughtful, durable gift, and I'd use it everyday. Good leather ages better with wear, so it wouldn't sit in a drawer.

Bedrock guardrail_intervened and content_filtered stops were reported as a normal end of turn, and context-window stops on Bedrock and Anthropic were not reported as truncation. Map every Converse StopReason and Anthropic's model_context_window_exceeded.

This branch has not been deployed

No deployments
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