Repository navigation
feat(claude): refuse Claude 5.x fallbacks and Mythos 5 on Bedrock - #4658
Merged
aheritier merged 3 commits intoOct 20, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused guards match the scoped requirements, preserve legacy behavior, and have regression coverage with no unresolved findings.
No open issues 🎉
What changed in this PR
Adds startup guards for unsupported Claude configurations in Docker Agent’s existing provider clients.
Changes:
- Rejects non-empty fallback chains involving the nine recognized Claude 5.x models.
- Refuses Mythos 5 on Bedrock Converse while allowing Mythos 5.1.
- Adds regression coverage and updates documentation, schema descriptions, and examples.
| File | Description |
|---|---|
pkg/modelinfo/claude5.go |
Marks Mythos 5 as Mantle-only. |
pkg/modelinfo/claude5_test.go |
Checks the new model flag. |
pkg/model/provider/bedrock/client.go |
Rejects Mantle-only models at construction. |
pkg/model/provider/bedrock/client_test.go |
Covers Mythos 5 rejection and 5.1 acceptance. |
pkg/model/provider/anthropic/vertex/vertex_test.go |
Checks Vertex fallback rejection. |
pkg/model/provider/anthropic/thinking_test.go |
Adjusts display-validation fixtures. |
pkg/model/provider/anthropic/thinking_binding.go |
Invokes fallback validation. |
pkg/model/provider/anthropic/thinking_binding_test.go |
Adjusts binding fixtures around the guard. |
pkg/model/provider/anthropic/features_integration_test.go |
Updates display and binding integration coverage. |
pkg/model/provider/anthropic/fallbacks.go |
Implements Claude 5.x fallback rejection. |
pkg/model/provider/anthropic/fallbacks_test.go |
Covers rejected and unchanged fallback configurations. |
examples/anthropic-fallbacks.yaml |
Uses a legacy-model fallback chain. |
docs/providers/bedrock/index.md |
Documents the Mythos 5 restriction. |
docs/providers/anthropic/index.md |
Documents fallback restrictions and updates examples. |
agent-schema.json |
Describes the temporary fallback restriction. |
Review effort: Balanced
#4584 Signed-off-by: Arnaud Héritier <aheritier@apache.org>
Signed-off-by: Arnaud Héritier <aheritier@apache.org>
- Drop the Fable example from the server-side fallback comment; that configuration is now rejected. - Build the Bedrock Mantle-only error from the configured model ID. - Move unit-test fixtures off Claude 5.x fallbacks that the constructor now rejects. Signed-off-by: Arnaud Héritier <aheritier@apache.org>
aheritier
force-pushed
the
feat/claude5x-safety-defaults
branch
from
October 20, 2026 06:41
782564e to
26b5321
Compare
trungutt
approved these changes
Oct 20, 2026
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.
Closes #4652. Part of #4583 and epic #4580.
What
Refuse two Claude 5.x configurations that docker-agent cannot serve correctly yet, at client construction and before any inference call:
fallbacksinvolving Claude 5.x are rejected when the primary or any fallback is one of the nine 5.x models (gateway and Vertex spellings included), until feat(Claude): end-to-end server fallback for Claude 5.x #4584 handles a mid-response model switch. The error points to feat(Claude): end-to-end server fallback for Claude 5.x #4584. Absent or empty lists and chains without a 5.x model are unchanged. Malformed lists stay ignored, as before.claude-mythos-5on Bedrock is refused. AWS serves it only through Bedrock Mantle, not the Converse API used here.claude-mythos-5-1still works. The model table gains aBedrockMantleOnlyfield.Both checks run where every construction path already validates options:
validateThinkingOptionsfor Anthropic Direct, Vertex and Model Garden, andbedrock.NewClientfor Bedrock. Clones, routing and gateway branches all pass through them.Fable 5/5.1 with
fallbacks(the headline refusal-fallback use case) now fails at startup. This follows the rollout policy approved in #4580: the request is refused rather than half-supported until #4584.examples/anthropic-fallbacks.yamland the docs example now useclaude-opus-4-8→claude-opus-4-7, and the docs carry a warning callout.Not in this PR
Making
thinking_prefix_mismatch: errorthe 5.x default moved to #4653. The runtime edits the conversation prefix (num_history_itemstrimming, hooks, compaction), soerrorwould break those sessions until signed history can be replayed exactly. Both issues are updated.References
Vendor documentation behind each change (all links checked on 2026-10-20):
claude-mythos-5refused on Bedrock: served only through Bedrock Mantle, not the runtime/Converse APIclaude-mythos-5-1still allowed on Bedrock Conversethinking_prefix_mismatch: errordefault deferred to #4653:errorrejects replayed thinking whose prefix changed, which the runtime does when trimming historyValidation
task buildpasses.golangci-lintv2.14.0 reports 0 issues, andgo run ./lint .reports no offenses.go test ./e2e -run '^TestWasmProviderDependencies$|^TestDependencies$'passes.task testfails only the 10 pre-existingpkg/teamloaderTestLoadExamplesGemini cases (GOOGLE_API_KEY or GEMINI_API_KEY environment variable is requiredunder.env.test). They fail identically onmain.26b5321.