fix(responses): carry rotated Kiro auth context into the terminal continuation (carry of #3502, 2/2) - #3562
Conversation
Carries the policy half of #3502 onto current dev, rebased, with docs rewritten on top of #3520 rather than replayed. 1. src/oauth/anthropic-routing.ts consulted the pool's proactive strategy even when the pool is disabled, so a disabled pool silently reactivated round-robin/fill-first on the reactive 429 path. Reactive recovery now uses the neutral quota picker there. 2. src/oauth/generic-account-failover.ts honoured only enabled === false per provider, so a provider-specific true could not opt back in when the global default is false. The published narrow-over-broad precedence now applies in both directions, and the typeof guard still lets a malformed value fall through rather than taking a provider out of service. The Kiro continuation half of #3502 is split into the next PR in the stack. Verification: - bun test tests/routing/always-on-429-failover.test.ts tests/oauth/generic-oauth-failover.test.ts tests/adapters/anthropic/anthropic-sidecar-account-failover.test.ts tests/oauth/adapter-event-oauth-failover.test.ts -> 43 pass / 0 fail (both new assertions RED before the source hunks) - bun test tests/test-layout.test.ts tests/test-layout-tooling.test.ts -> 17 pass / 0 fail - bun run typecheck -> exit 0 Co-authored-by: Ingwannu <186453546+Ingwannu@users.noreply.github.com>
…tinuation Second half of the #3502 split. The bounded terminal-guard continuation dispatches a shallow clone of the parsed request, so a 429 rotation that wrote _kiroAuthContext onto the outer request only left the clone carrying the FAILED account's region and profile ARN — a rotated bearer paired with an old identity, which is the mixed-identity failure applyFailoverSnapshot exists to prevent. applyFailoverSnapshot now takes the request being retried as a defaulted second parameter and synchronizes both owners, so every other call site is unchanged. The continuation call site passes nextParsed. Verification: - bun test tests/providers/kiro/kiro-auth-context-continuation.test.ts tests/oauth/generic-oauth-failover.test.ts tests/routing/always-on-429-failover.test.ts tests/test-layout.test.ts tests/test-layout-tooling.test.ts -> 53 pass / 0 fail (RED without the core.ts hunk: the third build carried kiro-access-1 with account 0's us-east-1 profile) - bun run typecheck -> exit 0 Co-authored-by: Ingwannu <186453546+Ingwannu@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. |
리뷰 · 우선순위 70 / 80이 PR은 #3561(스택 1층, OAuth proactive 경계) 위에 얹는 #3502의 나머지 반쪽입니다. 문제는 Kiro에서 요청 중간에 계정이 돌아가면, terminal-guard continuation이 src/server/responses/core.ts src/server/responses/core.ts continuation tests/providers/kiro/kiro-auth-context-continuation.test.ts - fixture adapter name이 tests/oauth/generic-oauth-failover.test.ts - #3502 - #3561+#3562가 랜딩하면 메인테이너의 판단이 필요한 지점
너의 추천 이 댓글은 grok-bot이 작성했습니다 |
Ingwannu
left a comment
There was a problem hiding this comment.
Approved on exact head 49c48662f5f3bad49f5034d544e168ca41427e0c, reviewing this stacked layer against codex/260905-oauth-failover-policy-boundaries. The continuation clone now receives the same rotated Kiro bearer-bound region/profile context as the outer parsed request; missing Kiro metadata fails away from stale mixed identity rather than preserving the failed account context. Isolated focused verification passed 27/27 and exact-head cross-platform CI is green. Land only after #3561, then retarget/revalidate as required by the stack order.
Ingwannu
left a comment
There was a problem hiding this comment.
The base has now moved to dev after #3561 was squash-merged as 71cfc8de696007c102c3fc7d644a451ce547cf68, but head 49c48662f5f3bad49f5034d544e168ca41427e0c still descends from the pre-squash parent commit c2ba04a... rather than the new dev tip. My earlier approval was explicitly for the stacked layer against that parent. Please rebase/rebuild the Kiro continuation commit onto current dev so the PR diff contains only layer B2, then rerun exact-head CI; I will re-approve the new head. Do not merge the merely retargeted pre-squash ancestry.
|
Maintainer admin merge (ruleset bypass recorded per MAINTAINERS.md): carry of #3502 (2/2), exact-head CI green on 49c4866 (24 pass / 2 skipped / 0 fail), stack layer above the merged #3561 (71cfc8d). Implementation review 023 found no blocker in this layer. wp2 Stack B of the 260905 open-work closeout. |
Summary
When a Kiro bearer is rotated mid-request, the terminal continuation was rebuilt with the failed account's region/profile.
applyFailoverSnapshotinsrc/server/responses/core.ts(:3367/:6699) now carries the rotated account's own routing data into the continuation.Carries #3502 (author @Ingwannu) onto current
dev; contributor hunks reapplied. Supersedes #3502 together with the 1/2 layer.Stack (merge bottom-up; each layer targets the branch below):
Depends on the layers below it. Review this PR's diff only. Unit:
devlog/_plan/260905_open_work_closeout/(020, 021, 022).Verification
bun run typecheck— exit 0 on this layer and on the stack top (d0f80e85f).bun test tests/providers/kiro/kiro-auth-context-continuation.test.ts— RED with thecore.tshunk reverted 25 pass / 2 fail (apiRegionexpectedeu-west-1, receivedus-east-1), GREEN 53 pass / 0 fail across five files.tests/lab/core-lab-boundary.test.ts.Checklist
codex/260905-oauth-failover-policy-boundaries(stack layer)Co-authored-bytrailer in the branch commitCo-authored-by: Ingwannu 186453546+Ingwannu@users.noreply.github.com