fix(bedrock): route non-Claude auxiliary models through Converse API (#60217) - #60479
Merged
kshitijk4poor merged 3 commits intoJul 7, 2026
Merged
Conversation
Auxiliary Bedrock resolution always used the Anthropic Bedrock SDK, which only works for Claude foundation-model IDs. Non-Claude models such as openai.gpt-oss-20b-1:0 now use a Bedrock Converse adapter, matching the main agent's bedrock_converse transport.
Assert gpt-oss Bedrock IDs resolve to BedrockAuxiliaryClient while Claude IDs keep the Anthropic SDK path, including async mode.
…nverse shim Review findings on the salvaged shim: (a) OpenAI callers may pass stop as a bare string but Converse's stopSequences requires a list — normalize; (b) call_llm(stream=True) (MoA aggregator) can reach this client and the shim silently returned a complete response — keep that behavior (the streaming consumer's got-final-object path downgrades gracefully) but log it, and log dropped tool_choice, instead of silently ignoring both. +2 regression tests. Follow-up to the salvage of NousResearch#60217 by @xxxigm.
kshitijk4poor
enabled auto-merge (rebase)
July 7, 2026 20:00
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Auxiliary Bedrock tasks (compression, memory, title generation, session search) now work with non-Claude Bedrock models: model IDs that aren't
anthropic.claude*route through a Converse-API shim instead of the Anthropic Bedrock SDK, which only accepts Claude foundation-model IDs.Root cause: the aws_sdk branch of
resolve_provider_client()unconditionally built anAnthropicAuxiliaryClient, so an aux model likeopenai.gpt-oss-20b-1:0failed — while the main agent already handled it via thebedrock_conversetransport.Changes
agent/auxiliary_client.py: newBedrockAuxiliaryClient(+ async wrapper) — OpenAI-client-compatible shim overbedrock_adapter.call_converse(); aws_sdk branch splits onis_anthropic_bedrock_model()(Claude keeps the Anthropic SDK path for prompt-caching/thinking parity);_maybe_wrap_anthropic+_to_async_clientdispatch guards — @xxxigm's fix, cherry-picked from fix(bedrock): route non-Claude auxiliary models through Converse API #60217tests/agent/test_bedrock_integration.py: routing + async tests — @xxxigmstopto a list (ConversestopSequencesrequires a list), and log droppedstream=True/tool_choiceinstead of silently ignoring them —call_llm(stream=True)(MoA aggregator) can reach this client; the complete-response return is kept because the streaming consumer's got-final-object path downgrades gracefully. +2 regression tests.Validation
openai.gpt-oss-20b-1:0(bedrock)stop="STOP"through shim["STOP"]Credit
Salvaged from #60217 by @xxxigm (commits cherry-picked, authorship preserved). Closes #60217.