Repository navigation
fix(anthropic): rebind reasoning-replay owner after pool rotation - #7193
vadymhimself wants to merge 1 commit into
Conversation
|
@coderabbitai review |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
✅ Action performedReview finished.
|
|
✅ Deterministic PR hygiene checks passed. |
ac78226 to
84eba62
Compare
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. This PR stays in draft until every box above is ticked. |
The Anthropic OAuth 429/403/401 rotation arms in adapter dispatch and the terminal continuation committed account B but left the reasoning-replay scope, native-reasoning owner, and provider-continuation owner bound to the refused account A. B was sent A's private continuation, the turn's state was persisted as owned by A, and the next turn on B stripped the replayed reasoning and dropped B's continuation as foreign. Rebind with the admitted credential snapshot, as the key-429 and generic OAuth arms already do; the continuation arm rebinds both parsed requests. Co-Authored-By: Claude Code <noreply@anthropic.com>
84eba62 to
cc2a752
Compare
|
Being carried into #7224 with your authorship preserved; this PR will be closed when the bundle lands. |
…evidence fixes (#7191, #7204, #7187, #7209, #7175, #7185, #7193, #7197, #7198) (#7224) Carried from #7191, #7204, #7187, #7209, #7175, #7185, #7193, #7197, #7198 (one commit per source PR, original author preserved). Security review follow-up: the Anthropic 402 combo cooldown now validates the sending credential's ownership before cooling an account. Remote validation (hosted GitHub Actions unreliable; local tests not run by maintainer rule): union candidate codex/prr-integ-8 = dev c03eafd + #7224 + #7223 + #7225 + #7217 + #6454 + #6594 plus a Gentle Shell import-cycle fix (integ-9 e1f289c: typecheck + full suite on mini (Windows) and lidge (Linux), compared with the same host's dev runs) and a test-only Windows path-escaping fix for the reasoning-retention routing test (integ-10 0d4cba7, tree a2b309a: that file re-run on both hosts). Co-authored-by: Vadym O <bolein95@gmail.com>
Summary
adapter-dispatch.ts) and the terminal continuation retry (adapter-continuation.ts) commit the next account B but never rebind the route's replay scope.commitResolvedOAuthSelectionalready updatesreplayOAuthCredentialSnapshot, but nothing callsbindRouteReasoningReplayScopewith it, so the reasoning-replay serving identity, the native-reasoning owner and the provider-continuation owner stay bound to the refused account A.dev(reproduced by the new test):private-a).__ocxOwner.credentialIdentity= A._stripReasoningEncryptedContent, which makes the Anthropic adapter drop replayed thinking blocks, and it discards B's continuation as foreign. The client loses reasoning continuity, and the changed history breaks the prompt-cache prefix, so the cache gets written again.transportState.replayOAuthCredentialSnapshot. This is the same call the key-429 and generic OAuth (Kiro/Antigravity) arms already make. The continuation arm rebinds bothnextParsedand the outerparsedthat persists the response, as its key-429 arm does. No new helper or state.git merge-treeagainst that branch merges cleanly.Verification
dev(60bf4c7) with the source change reverse-applied: both newtests/adapters/terminal-continuation-owner-rotation.test.tscases (Anthropic pool rotation on the initial send …and… on the terminal continuation …) fail. The persisted owner is A, B's build carriesprivate-a, and the follow-up build on B hasstripReasoning: truewith no continuation.bun test tests/adapters/terminal-continuation-owner-rotation.test.tsgives 3 pass, 0 fail.bun run typecheck: passes.bun run structure:check: passes.bun run privacy:scan: passes.bun run test:changed(againstdev60bf4c7): 14561 pass, 1 fail across 575 files. The failure istests/cli/cli-connect-readiness.test.ts›connected-client runtime probe scope > a rejected preferred runtime falls back without rewriting the saved selection. It also fails on a cleandevworktree and is unrelated to this change.bun run testlocally.test:changedcovers the import graph of both changed source files, and CI covers the rest.Checklist
🤖 Generated with Claude Code
Summary by CodeRabbit
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
Required local validation passed; commands, results, and any full-suite exception are documented.
I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.