Skip to content

fix(anthropic): retain explicit Fable rejection scope - #1041

Merged
fuller-stack-dev merged 2 commits into
mainfrom
openclaw/good-krill
Nov 13, 2026
Merged

fuller-stack-dev merged 2 commits into
mainfrom
openclaw/good-krill

Conversation

@fuller-stack-dev

Copy link
Copy Markdown
Member

Summary

  • Preserve Fable-family scope only when a subscription Fable 429 contains an explicit native named-Fable-limit error, healthy shared allowance evidence, and a rejection deadline. Keep the independent deadline across usage snapshots so a different Claude family remains eligible without prematurely readmitting Fable versions.
  • Reuse the bounded JSON error inspector. Preserve generic/shared/authentication and independent cooldowns, policy scope, accounting, and the existing four-distinct-grant retry bound. No quota bypass, extra retry budget, paid fallback, or live configuration change.

Evidence and provenance

The reproduced defect is sibling-model exclusion after an explicit Fable refusal; attribution to the historical c5f058aa incident remains unproven.

The refusal wording comes from Magpie commit 82512bb64052e816a5003df67a795636d8c4f31e, internal/gateway/claude_model_limit_rest_test.go lines 10–27: a reported Claude Code refusal originally attributed there to YsiCing. The JSON envelope in this regression is test-constructed, NOT a captured direct Anthropic HTTP response. Anthropic's official Fable plan documentation establishes the shared Fable 5/5.1/5.2 allowance within general weekly usage, not the fixture's wire origin.

Verification

  • Final candidate: Worker TypeScript no-emit check and 72/72 named-limit/refresh-routing tests passed (18 named-limit, 54 refresh-routing).
  • Earlier affected quota/runtime/pool/scope/limit-switching suite: 108/108 passed; subsequent changes only expanded the new test fixture/assertions. The unchanged 92 existing tests retain their evidence; the earlier 16 named-limit tests are superseded by the final 18-test pass. Credit exclusion: 21/21 passed on unchanged production code. Earlier uncommitted executions did not capture a separate whole-tree hash.
  • Independent non-author review: no P0–P2 findings; executed 18 named-limit tests, two expected base-source failures with two green controls, four credit-inspector cases, and Worker/SQLite cold-persistence/fragmented-body probes.
  • Canonical ClawRouter API autoreview: 1/1 pass, scoped-clean at P0–P2 on source commit 75ffdb5, tree 66e27f420e765f525cf511195105cbad0af65816, base 4f806f6. P3 was outside that API review threshold; tests were not rerun by the API reviewer.
  • Diff checks clean. Hosted CI must validate the actual published head.

Deployment status / remaining risk

Not deployed; no service restart, credential/pool mutation, or production inference probe. This intentionally narrow recognition does not classify generic 429s or clear ambiguous independent account cooldowns. Fixture provenance and unproven historical incident linkage are explicit limitations.

@clawsweeper

clawsweeper Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 13, 2026
@clawsweeper

clawsweeper Bot commented Nov 13, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge.

What this changes

This PR keeps explicit Fable-only rate-limit rejections scoped to the Fable family while preserving eligibility for other Claude models.

Example: A subscription request for claude-fable-5-2 receives the recognized named-limit error, healthy shared allowance headers, and Retry-After: 90.

  • Before: The grant enters account-wide cooldown, also excluding claude-sonnet-5.
  • After: Claude Sonnet remains eligible while Fable 5, 5.1, and 5.2 remain excluded for 90 seconds.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The implementation is focused and source-consistent, but the required behavior proof is currently limited to mocked transport and unsupported execution summaries.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A Fable-only refusal can temporarily prevent otherwise eligible requests for other Claude families.
Reason: The direction is maintainer-authored and restores the existing model-scoped eligibility contract without introducing configuration or another state owner.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR addresses a source-verifiable routing gap that remains on main; inspection found no concrete introduced bug.

Priority: P2
Reviewed head: 01d3418be0bfa0a95b081123b37209afd4b3373a

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Supply a redacted request/response trace through the real Worker and transport showing the recognized 429, successful Sonnet selection, and continued Fable-family exclusion until the deadline.
Agent review details

How this fits together

The Worker observes upstream responses, records grant quota feedback, and uses existing runtime merging and model-aware selection to admit subsequent requests.

flowchart LR
  A[Client request] --> B[Grant selection]
  B --> C[Anthropic request]
  C --> D[Bounded error inspection]
  D --> E[Quota feedback]
  E --> F[Runtime merge and persistence]
  F --> B
Loading

Technical review

Best possible solution:

Retain the focused classifier and existing quota owner, then establish the recognized response shape and resulting routing behavior through the production transport boundary.

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

Main demonstrably applies account-wide cooldown to the constructed named-error case without explicit model-window headers; occurrence of that exact native upstream envelope remains unconfirmed.

Is this the best way to solve the issue?

The patch uses the existing bounded inspector, model-scoped windows, persistence, and retry loop, with no definite correctness defect found.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 1f12686c1448.

Provenance checked

  • Anthropic rejection classification keeps the original intent (626ee0f: Recognize explicit model-specific limits only with healthy shared-window evidence, while retaining conservative cooldown for ambiguous signals.)
  • Bounded upstream error inspection keeps the original intent (e2beb17: Inspect explicit credit rejections within bounded reads, preserve response bytes, and reuse quota feedback and pre-delivery failover.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned introduced change: The introduced diff changes only quota classification, response-body forwarding into that classifier, and focused routing tests; base-only benchmark and changelog changes do not belong to this PR. (worker/provider-quota.ts:22, 01d3418be0bf)
  • Current-main gap: Main recognizes model-only rejection through explicit unified status and 7d_oi headers; the named error-body recognition is absent. (worker/provider-quota.ts:22, 1f12686c1448)
  • Existing scoped-window contract: The documented contract already supports family tokens, model-specific exhaustion, per-window timestamps, and independent inference cooldowns. (docs/api-reference.md:739, 01d3418be0bf)
  • Proof and fixture provenance: The full body and both comments were read. The body credits Magpie's reported refusal wording but explicitly identifies the native JSON envelope as constructed; reported test and cold-persistence passes include no inspectable transport trace or artifact. Captured body source identity: 929e40230d41a141f5247bce63615e6d78e63ba2c51375282f58b998395af563.
  • Inspectable test boundary: The new tests enter worker.fetch but replace global fetch with synthetic responses; they cover sibling eligibility, family expiry, alternate selection, retry bounds, malformed errors, snapshots, and independent cooldowns. (worker/test/claude-named-limit.test.mjs:32, 01d3418be0bf)
  • Existing persistence compatibility: upstream_grant_runtime.state_json already stores normalized generic quota windows; the new ID, retry_after value, family token, and deadline fit existing fields and validation without changing schema or rewriting existing rows. (worker/authority.ts:1594, 01d3418be0bf)

Likely related people:

  • Jason (Json): Raw commit 626ee0f adds worker/provider-quota.ts:13 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 626ee0f79d8d; files: worker/provider-quota.ts)
  • Peter Steinberger: Raw commit e2beb17 adds worker/provider-quota.ts:10 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e2beb177e748; files: worker/provider-quota.ts)

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: The change addresses unnecessary exclusion of healthy sibling models after a narrowly recognized subscription rejection, with no established widespread outage.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: The change addresses unnecessary exclusion of healthy sibling models after a narrowly recognized subscription rejection, with no established widespread outage.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Provide the production-transport trace described in the proof assessment.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 13, 2026, 1:03 PM ET / 18:03 UTC.

@fuller-stack-dev
fuller-stack-dev merged commit 43d978e into main Nov 13, 2026
59 checks passed
@fuller-stack-dev
fuller-stack-dev deleted the openclaw/good-krill branch November 13, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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.

1 participant