Skip to content

fix(anthropic): Fable 5 skips context1m setup when enabled - #100572

Merged
vincentkoc merged 1 commit into
openclaw:mainfrom
zhangguiping-xydt:fix/problem-fable-5-context1m-wrapper
Jul 6, 2026
Merged

vincentkoc merged 1 commit into
openclaw:mainfrom
zhangguiping-xydt:fix/problem-fable-5-context1m-wrapper

Conversation

@zhangguiping-xydt

@zhangguiping-xydt zhangguiping-xydt commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where Anthropic users selecting Claude Fable 5 with context1m enabled would not get the same stream wrapper behavior as other 1M-context Claude models, even though Fable 5 is registered with a 1,000,000-token context window.

Why This Change Was Made

The Anthropic stream wrapper now treats Fable 5 as a 1M-context model by reusing the shared Fable 5 model identity helper. This keeps the wrapper predicate aligned with provider model registration while preserving the identity boundary so claude-fable-50 is not matched as Fable 5.

User Impact

Claude Fable 5 now follows the expected context1m provider-wrapper path. Other Anthropic 1M model prefix handling is unchanged, and non-Fable lookalike model ids remain outside this Fable-specific path.

Evidence

  • Real wrapper/provider-path proof: imported the Anthropic stream wrapper and ran it with context1m: true before any network call. Fable 5 receives the provider beta wrapper headers while the lookalike claude-fable-50 does not:

    [
      {
        "modelId": "claude-fable-5",
        "context1m": true,
        "anthropicBeta": "fine-grained-tool-streaming-2025-05-14,interleaved-thinking-2025-05-14",
        "serviceTier": "auto"
      },
      {
        "modelId": "claude-fable-50",
        "context1m": true,
        "anthropicBeta": null,
        "serviceTier": "auto"
      }
    ]
    
  • Focused regression tests:

    node scripts/run-vitest.mjs run extensions/anthropic/stream-wrappers.test.ts extensions/anthropic/provider-policy-api.test.ts
    
    Test Files  2 passed (2)
         Tests  32 passed (32)
    

@zhangguiping-xydt zhangguiping-xydt changed the title Claude Fable 5 is registered as a 1M context model but the Anthropic context1m stream wrapper predicate does not include it fix(anthropic): Fable 5 skips context1m setup when enabled Jul 6, 2026
@clawsweeper

clawsweeper Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 6, 2026, 4:42 AM ET / 08:42 UTC.

Summary
The PR imports the shared Claude Fable 5 identity helper into the Anthropic stream wrapper predicate and adds regression coverage for Fable 5 versus claude-fable-50 under context1m.

PR surface: Source +4, Tests +11. Total +15 across 2 files.

Reproducibility: yes. at source level. Current main and v2026.6.11 register Fable 5 as a 1M Anthropic model, but the context1m wrapper predicate only recognizes Opus/Sonnet 1M prefixes until this PR changes it.

Review metrics: none identified.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Next step before merge

  • [P2] No repair lane is needed; this external PR already has a narrow fix, focused coverage, and sufficient real behavior proof.

Security
Cleared: The diff only reuses an existing SDK-exported model identity helper and adds tests; it does not add dependencies, secret handling, CI, package, or supply-chain surface.

Review details

Best possible solution:

Land the helper-based wrapper predicate fix with its focused regression coverage after the normal exact-head CI and maintainer merge gates pass.

Do we have a high-confidence way to reproduce the issue?

Yes, at source level. Current main and v2026.6.11 register Fable 5 as a 1M Anthropic model, but the context1m wrapper predicate only recognizes Opus/Sonnet 1M prefixes until this PR changes it.

Is this the best way to solve the issue?

Yes. Reusing the shared Fable 5 identity helper is the narrowest maintainable fix because it keeps the existing lookalike boundary instead of adding another provider-local prefix rule.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 489af13dbd9e.

Label changes

Label justifications:

  • P2: This is a bounded Anthropic provider bug fix for one model-family predicate with limited blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body contains redacted copied live output showing the after-fix wrapper/provider path for Fable 5 and the negative claude-fable-50 boundary case.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body contains redacted copied live output showing the after-fix wrapper/provider path for Fable 5 and the negative claude-fable-50 boundary case.
Evidence reviewed

PR surface:

Source +4, Tests +11. Total +15 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 4 0 +4
Tests 1 14 3 +11
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 18 3 +15

What I checked:

Likely related people:

  • steipete: Authored the merged Fable 5 support work and several adjacent Anthropic/Fable changes, including model contracts and recent boundary work. (role: feature owner and recent area contributor; confidence: high; commits: 63b81ac0950f, 9b695ca8be1e, da567ca5164f; files: extensions/anthropic/openclaw.plugin.json, packages/llm-core/src/model-contracts/anthropic.ts, extensions/anthropic/provider-policy-api.ts)
  • haoyu-haoyu: Authored the merged Anthropic GA 1M migration that shaped the context1m stream-wrapper behavior this PR aligns for Fable 5. (role: GA 1M context migration contributor; confidence: medium; commits: 9c26a2750a10; files: extensions/anthropic/stream-wrappers.ts, extensions/anthropic/stream-wrappers.test.ts, docs/providers/anthropic.md)
  • vincentkoc: Contributed commits to the merged GA 1M migration and is assigned on the live PR, making them a plausible routing owner for this wrapper-path review. (role: GA 1M context migration contributor and current reviewer assignee; confidence: medium; commits: 8b6c054634ae, 0a92a6b72f9b; files: extensions/anthropic/stream-wrappers.ts, extensions/anthropic/stream-wrappers.test.ts)
  • Pandah97: Opened the Fable 5 boundary-guard PR whose logic was later carried into current main near this helper boundary. (role: adjacent Fable boundary contributor; confidence: medium; commits: 21a6e9b2d9e9, ee93c5ce757f; files: extensions/anthropic/provider-policy-api.ts, extensions/anthropic/provider-policy-api.test.ts, src/agents/context-resolution.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (2 earlier review cycles)
  • reviewed 2026-07-06T03:19:34.685Z sha 40eb923ad77b1a5062a9d137083d99d358326387 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-06T04:56:39.894Z sha 40eb923ad77b1a5062a9d137083d99d358326387 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 6, 2026
@zhangguiping-xydt

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

I added redacted real wrapper/provider-path proof to the official Evidence section: claude-fable-5 with context1m: true now shows the Anthropic beta wrapper headers, while claude-fable-50 stays unmatched, plus the focused regression suite still passes.

@clawsweeper

clawsweeper Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 6, 2026
@vincentkoc vincentkoc self-assigned this Jul 6, 2026
@vincentkoc
vincentkoc force-pushed the fix/problem-fable-5-context1m-wrapper branch 3 times, most recently from 3b8df4d to 991845e Compare July 6, 2026 08:27
@vincentkoc
vincentkoc force-pushed the fix/problem-fable-5-context1m-wrapper branch from 991845e to b5372cc Compare July 6, 2026 08:43
@vincentkoc
vincentkoc merged commit 3702283 into openclaw:main Jul 6, 2026
90 checks passed
@vincentkoc

Copy link
Copy Markdown
Member

Merged via squash.

xialonglee added a commit to xialonglee/openclaw that referenced this pull request Jul 7, 2026
The resolveAnthropicFixedContextWindow fable-5 guard only matched
anthropic and anthropic-vertex providers, leaving claude-cli unhandled.
Without this, claude-cli + claude-fable-5 fell through to the GA 1M
prefix check where fable-5 doesn't match, returning undefined and
causing fallback to the default 200K context window.

Both call paths were affected:
- resolveContextTokensForModelFromCache (direct)
- resolveDiscoveredAnthropicFixedContextWindow (discovery cache upgrade)

Same root cause as openclaw#100572: new model added to catalog but claude-cli
provider boundary was not enumerated.

Fix: add provider === 'claude-cli' to the fable-5 guard, matching the
pattern already used by the GA 1M guard on the next branch.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: anthropic P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants