Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughChangesOAuth cancellation flow
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant CodexAuthAPI
participant OAuthLifecycle
participant LoginFlowState
CodexAuthAPI->>OAuthLifecycle: startLoginFlow({ flowId })
OAuthLifecycle->>LoginFlowState: store abort controller and flowId
CodexAuthAPI->>OAuthLifecycle: cancelLoginFlow("chatgpt", flowId)
OAuthLifecycle->>LoginFlowState: validate active flowId
CodexAuthAPI->>LoginFlowState: expireCodexAuthFlow(flowId)
Merge Risk: ⚪ Minimal · up to Cancellation now targets only the owning pending login flow and rejects stale or missing flow IDs. The change is ready to merge after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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 |
|
리뷰 · 우선순위 76 / 80이 PR은 지금 고치는 방법은 간단합니다.
테스트는 예전 「취소하면 pending flow가 error」 한 줄을 빼고, 한 가지 제품 동작이 바뀝니다. 라인 531-540 - 메인테이너의 판단이 필요한 지점
너의 추천 이 댓글은 grok-bot이 작성했습니다 |
⏳ DRAFT
What to do
Review readiness checklist
✅ 4/4 boxes ticked. This pull request was already a draft. Its draft status will be preserved after every issue above is resolved. |
|
Exact-head CI is green on the posted head On the inline findings:
On your judgment points: keeping the un-optioned Codex cancel blocked (rather than adding a convenience lookup) is the safer default in my view — a wrong- Requesting |
|
Addressed the review findings in
The PR remains in the |
The provider-keyed loginAbort map let a cancel request for an expired login modal abort a newer login flow for the same provider. Bind each attempt to its flowId, verify the pending flow before cancelling, and reject stale or missing flow ids with 400.
A bare ocx account cancel chatgpt posted { flowId: undefined } and surfaced as a bare 400. Refuse it as a usage error that names the flag ocx account login prints, matching the existing code-path requirement, and mark --flow as required for codex in the usage line.
96974b5 to
3ed2ebf
Compare
Summary
POST /api/codex-auth/login/cancelis keyed only by provider:cancelLoginFlow("chatgpt")aborts whicheverAbortControlleris currently registered for the provider, andexpireCodexAuthFlowmarks the supplied (or every pending) flow row as cancelled. A stale login modal can therefore POST its oldflowIdand silently abort a newer login flow that the user just started — the replacement attempt dies behind the fresh modal.This binds each login attempt to the
flowIdthat owns it and validates cancellation against the pending-flow registry:loginAbortentries now record{ controller, flowId };startLoginFlowpropagates the caller''sflowIdthroughLoginFlowLifecycle.cancelLoginFlow(provider, flowId?)refuses to abort when the active attempt''sflowIddoes not match. Callers that omitflowId(e.g. the generic/api/oauth/login/cancelroute) keep the existing provider-wide semantics.handleCodexAuthLoginCancelnow requiresflowId, rejects unknown/expired/non-pending flows with 400 (matching/login/codevalidation), and only then cancels and expires that exact flow — it can no longer wipe every pending flow whenflowIdis absent.flowIdis rejected without touchingcancelLoginFlow; the owning flow''s cancel passes("chatgpt", flowId)through.Note:
ocx account cancel chatgptwithout--flownow receives a clear400 flowId requiredinstead of cancelling the active attempt; pass--flow <flow-id>(printed byocx login) to target the attempt.Verification
410146c3993aa918d142c0490f0d042881cbdd84(treebb28ceb6cb908815cde53936046c21d76c6c3b7e), baseorigin/dev2f025814f3b85a027e8c76f913b1e10f342aba5e.bun x tsc --noEmit— clean.bun run structure:check— passed.bun run privacy:scan— passed.bun scripts/file-size-ratchet.ts— passed (keptsrc/oauth/index.tsunder the 2000-line threshold).bun test tests/codex-integration/codex-auth-api.test.ts— 340 pass / 0 fail.bun test tests/oauth/oauth-manual-code.test.ts tests/oauth/oauth-public-surface.test.ts— 32 pass / 0 fail.Remaining gates
macos controlwas cancelled at the known 30-minutetimeout-minutescap tracked in [Bug]: macOS control is cancelled near its 30-minute limit in full dispatch CI #4905, which is not caused by this change.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:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.