Support claude-fable-5-1 and claude-mythos-5-1 - #179
Closed
iceteaSA wants to merge 2 commits into
Closed
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 15 files
Architecture diagram
sequenceDiagram
participant User as Plugin Session
participant Catalog as Pi/OpenCode Model Catalog
participant Core as Core Model Registry
participant Transform as Request Normalizer
participant OAuth as OAuth Header Builder
participant Recovery as Recovery and Fallback Manager
participant Quota as OAuth Quota Matcher
participant Anthropic as Anthropic API
Note over User,Anthropic: Runtime flow for Claude Fable 5.1 and Mythos 5.1
User->>Catalog: Select model by id
Catalog->>Core: Resolve model specification
Core-->>Catalog: Model name, capabilities, limits, pricing
Catalog-->>User: 1M context, 128K output, reasoning and tool support
User->>Recovery: Start request with selected model
Recovery->>Recovery: Classify recovery family
alt Fable 5.1
Recovery->>Recovery: Use isolated fable-5-1 recovery state
else Mythos 5.1
Recovery->>Recovery: No content-filter recovery downgrade
end
Recovery->>Transform: Normalize request body
Transform->>Transform: Map manual or disabled thinking to adaptive
Transform->>Transform: Preserve effort low, medium, high, xhigh, or max
alt Forced tool_choice is any or tool
Transform->>Transform: Strip tool_choice
else Other tool_choice or no tool_choice
Transform->>Transform: Preserve request field
end
Transform-->>Recovery: Normalized request body
Recovery->>Quota: Match model to OAuth quota scope
Quota-->>Recovery: Shared claude-weekly-scoped-fable window
Recovery->>OAuth: Build OAuth request headers
OAuth->>OAuth: Attach server-side-fallback-2026-07-01 beta
OAuth-->>Recovery: Authorization and Anthropic beta headers
Recovery->>Anthropic: POST messages with normalized body and headers
alt Successful response
Anthropic-->>Recovery: Stream or complete response
Recovery-->>User: Return model response
else Recoverable content-filter refusal for Fable 5.1
Anthropic-->>Recovery: Refusal response
Recovery->>Recovery: Activate fable-5-1 recovery cycle
Recovery->>Anthropic: Retry with configured fallback model
Anthropic-->>Recovery: Fallback response
Recovery-->>User: Return response with recovery status
else HTTP 400 caused by forced tool_choice
Anthropic-->>Recovery: Request validation error
Recovery-->>User: Return API error
end
opt Cache prewarm or lane-start request
User->>Transform: Prepare model-specific request
Transform->>Transform: Apply the same 5.1 normalization rules
Transform-->>User: Request body for cache or lane operation
end
Note over Core,Catalog: Mythos 5.1 is cataloged as limited and is intended for Glasswing-only usage
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
ualtinok
added a commit
that referenced
this pull request
Sep 2, 2026
Reconcile the two contributed implementations against captured Claude Code 2.1.258 traffic, including model metadata, billing identity, conditional thinking-prefix controls, Pi support, and documentation. Co-authored-by: iceteaSA <171169159+iceteaSA@users.noreply.github.com>
Contributor
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.
Adds model support for Fable 5.1 and Mythos 5.1, released this week. Claude Code 2.1.257 already defaults to
claude-fable-5-1(confirmed on the wire), so a plugin session that selects it currently falls through to default handling.What's here
models.ts) forclaude-fable-5-1andclaude-mythos-5-1: 1M context, 128K max output, $10/$50 in/out per MTok. Cache read drops to $0.25/MTok (down from $1 on 5.0); 1h cache write stays $20.thinkingis stripped to adaptive, same as Fable 5. Effort variants (low..max) pass through.tool_choicestripped for 5.1 only. 5.1 rejectstool_choice: any/{type:"tool"}with a 400 (new vs 5.0). The normalizer deletes the field on every request path — main turns, lane-start, and cache prewarm. Fable 5 and Opus are untouched.server-side-fallback-2026-07-01beta exactly like Fable 5 / Opus 5.fable-5-1), checked before thefable-5prefix so a 5→5.1 model switch can't cross-contaminate an in-flight recovery cycle.claude-fable-5-1request counts against the sameclaude-weekly-scoped-fablewindow as Fable 5, matching how the plans meter both.Verification
1322 tests pass (0 fail; the one flaky
relay-worker-miniflareparallel timeout solo-greens). Typecheck, format, biome clean. Cross-family review (GLM) approved 0 must; the normalization, tool_choice strip, family key, and scoped-quota matcher each carry a mutation-proven test.Mythos 5.1 is Glasswing-only, so its path is present but unexercised here.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Adds model support for the newly released Fable 5.1 and Mythos 5.1. Without it, sessions using these models fall through to default handling.
New Features
claude-fable-5-1andclaude-mythos-5-1with 1M context, 128K max output, and $10/$50 per MTok pricing.Behavior Changes
tool_choicefor 5.1 only; 5.1 rejects it with a 400 error.fable-5-1) so a 5→5.1 switch stays isolated.Written for commit aa69996. Summary will update on new commits.