Repository navigation
Conversation
docker#4584 Signed-off-by: Arnaud Héritier <aheritier@apache.org>
Signed-off-by: Arnaud Héritier <aheritier@apache.org>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The scoped safeguards use existing construction validation paths, preserve permitted configurations, and have focused regression coverage with no unresolved blocking findings.
No open issues 🎉
What changed in this PR
Adds startup safeguards for unsupported Claude 5.x configurations, building on the request-policy changes in #4655.
Changes:
- Rejects non-empty fallback chains involving known Claude 5.x models until #4584.
- Refuses Mythos 5 on Bedrock Converse while allowing Mythos 5.1.
- Adds regression tests and updates documentation, schema descriptions, and fallback examples.
| File | Description |
|---|---|
pkg/runtime/structured_output.go |
Stops unsupported Claude 5.x reminder retries. |
pkg/runtime/structured_output_test.go |
Tests failure after one plain-text response. |
pkg/runtime/loop.go |
Passes model identity to structured-output handling. |
pkg/modelinfo/thinking_levels.go |
Enables Claude 5.x effort levels. |
pkg/modelinfo/modelinfo.go |
Uses explicit Claude 5.x capabilities. |
pkg/modelinfo/claude5.go |
Defines model policies and Mantle-only status. |
pkg/modelinfo/claude5_test.go |
Tests model recognition and policies. |
pkg/model/provider/providerutil/prefill.go |
Detects final assistant prefills. |
pkg/model/provider/providerutil/prefill_test.go |
Tests prefill detection. |
pkg/model/provider/providers/claude5_requests_test.go |
Checks requests through provider factories. |
pkg/model/provider/factory.go |
Warns when thinking cannot be disabled. |
pkg/model/provider/factory_test.go |
Tests warning conditions. |
pkg/model/provider/bedrock/client.go |
Enforces Claude policies and refuses Mythos 5. |
pkg/model/provider/bedrock/client_test.go |
Tests request policies and Mythos restrictions. |
pkg/model/provider/anthropic/vertex/vertex_test.go |
Tests fallback rejection on Vertex. |
pkg/model/provider/anthropic/thinking.go |
Preserves thinking intent and default effort. |
pkg/model/provider/anthropic/thinking_binding.go |
Adds fallback validation during construction. |
pkg/model/provider/anthropic/thinking_binding_test.go |
Updates binding expectations and warning coverage. |
pkg/model/provider/anthropic/system_context_test.go |
Uses a legacy model for prefill coverage. |
pkg/model/provider/anthropic/features_integration_test.go |
Tests thinking, prefills, and fallback restrictions. |
pkg/model/provider/anthropic/fallbacks.go |
Rejects fallback chains involving Claude 5.x. |
pkg/model/provider/anthropic/fallbacks_test.go |
Covers rejected and permitted fallback configurations. |
pkg/model/provider/anthropic/client.go |
Rejects Claude 5.x assistant prefills locally. |
pkg/model/provider/anthropic/capabilities.go |
Applies explicit model capabilities. |
pkg/model/provider/anthropic/capabilities_test.go |
Tests capability predicates. |
examples/anthropic-fallbacks.yaml |
Switches to a permitted legacy fallback chain. |
docs/providers/bedrock/index.md |
Documents policies and Mantle restrictions. |
docs/providers/anthropic/index.md |
Documents Claude 5.x behavior and fallback refusal. |
agent-schema.json |
Updates provider-option descriptions. |
Review effort: Balanced
- 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>
This was referenced Oct 19, 2026
Collaborator
Author
|
Superseded by #4658: same commits, moved to a |
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.Validation
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.782564e.