Repository navigation
fix(oauth): rebind continuation replay scope after generic OAuth 429 failover - #4926
Conversation
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Deterministic PR hygiene checks passed. |
리뷰 · 우선순위 76 / 80이 PR은 continuation 루프의 generic OAuth 429 failover 경로에서 credential만 바꾸고 reasoning replay 소유자를 안 바꾸던 구멍을 막습니다. 현재 테스트는 라인 src/server/responses/adapter-continuation.ts (generic OAuth continuation arm) - 경로 tests/oauth/generic-oauth-failover.test.ts - 소스 슬라이스 길이·문자열 매칭으로 팔을 고정합니다. refactor로 주석/공백만 바뀌어도 깨질 수 있는 테스트지만, “이 팔에 바인딩이 빠지면 안 된다”는 회귀를 값싸게 잡는 목적에는 맞습니다. 가능하면 나중에 실제 429→continuation 후 replay scope 소유자가 새 계정인지 확인하는 동작 테스트가 있으면 더 단단합니다. 경로 createAdapterContinuations deps - 메인테이너의 판단이 필요한 지점
너의 추천 이 댓글은 grok-bot이 작성했습니다 |
✅ READY
Hygiene✅ Deterministic PR hygiene checks passed. |
Summary
applyFailoverSnapshotbut never rebinds the reasoning replay scope. Both the terminal-guard clone (nextParsed) and the outer request (parsed) keep the failed account's replay identity, so the replayed continuation can disclose or cache reasoning under the previous account's scope (cross-account reasoning disclosure / cache contamination).bindRouteReasoningReplayScoperight after the newactiveAdapterresolves, passingoauthCredentialSnapshot: transportState.replayOAuthCredentialSnapshot. The key-pool arm directly above already rebinds both owners; the snapshot argument matches what the dispatch-path OAuth arms pass.applyFailoverSnapshotupdatestransportState.replayOAuthCredentialSnapshotto the admitted account before this point, so the rebind binds the replacement identity.transportStatepick list by the single field the rebind reads, and add a source-level regression unit asserting both rebinds in the continuation arm.Verification
2f025814f3b85a027e8c76f913b1e10f342aba5e(origin/dev at branch time); head655bdc03c54fa7ee26660aa23a106ae6416e632e/ tree2dd80c19b0d0ed849bc59c5b35868d56d93ad3f8.bun x tsc --noEmit- clean.bun run structure:check,bun run privacy:scan,bun scripts/file-size-ratchet.ts- all pass.bun test tests/oauth/generic-oauth-failover.test.ts- 44 pass / 0 fail, including the new regression unit.bun test tests/adapters/terminal-continuation-owner-rotation.test.ts- 1 pass / 0 fail.windows 8/9, which failed intests/cli/cli-ready-subprocess.test.ts(ready --wait exits immediately on terminal failed readiness: expected exit 1, got 0 after the 10s bound) - a CLI readiness subprocess test outside this PR's changed surface, matching the scattered per-shard flake pattern seen on other heads.macos controlhit the known 30-minute dispatch cap tracked in [Bug]: macOS control is cancelled near its 30-minute limit in full dispatch CI #4905, and the remaining queued lanes (test 1/4, 2/4, 4/4, keyring macos, npm-global macos, docker smoke, macos 1/2) were cancelled with it.Remaining gates
adapter-dispatch.tsapplies the failover snapshot through the same helper without a replay-scope rebind onparsed. Kept out of this PR to stay minimal; happy to follow up if wanted.Review readiness checklist
Summary by CodeRabbit