Skip to content

fix(claude-sdk-oauth): close browser callback prompt (LAB-33) - #663

Open
eddieparc wants to merge 2 commits into
code-yeongyu:mainfrom
eddieparc:lab-33-oauth-input-lifecycle-v2
Open

fix(claude-sdk-oauth): close browser callback prompt (LAB-33)#663
eddieparc wants to merge 2 commits into
code-yeongyu:mainfrom
eddieparc:lab-33-oauth-input-lifecycle-v2

Conversation

@eddieparc

@eddieparc eddieparc commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

https://linear.app/jgplabs/issue/LAB-33/다중-계정-로그인-입력-필드가-중복-동기화됨

Summary

  • forward the Anthropic OAuth prompt AbortSignal through the extension OAuth adapter
  • close the pending manual-code input when the localhost browser callback wins
  • prevent account naming from overlapping the stale manual input

Verification

  • RED then GREEN: lab-33-claude-oauth-prompt-abort.test.ts
  • changed production-file LSP diagnostics: clean
  • npm run check: clean
  • Claude OAuth scoped suite: 4 files / 10 tests passed
  • real Orca/xterm.js QA: one account-name input, no mirrored field, isolated auth state

Summary by cubic

Closes the stale manual-code prompt when the browser callback completes in the claude-sdk-oauth extension. Prevents duplicated inputs and mirrored account naming in multi-account login (LAB-33).

  • Bug Fixes
    • Pass the full provider prompt to onPrompt (message, placeholder, signal) via the OAuth adapter.
    • Abort and close the manual-code input when the localhost browser callback wins.
    • Add regression test lab-33-claude-oauth-prompt-abort.test.ts to verify signal forwarding and prompt abort.

Written for commit d6ab6cd. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 3 files

You’re at about 98% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/coding-agent/test/suite/regressions/lab-33-claude-oauth-prompt-abort.test.ts">

<violation number="1" location="packages/coding-agent/test/suite/regressions/lab-33-claude-oauth-prompt-abort.test.ts:20">
P3: This test never aborts the signal while the manual-code prompt is still pending: onPrompt resolves immediately, then controller.abort() runs afterwards, so the `aborted === true` assertion is satisfied trivially by the test's own post-completion abort. The signal-forwarding check (`callbackSignal === providerSignal`) is valid, but the stated regression behavior — closing a still-open manual-code prompt when the localhost browser callback wins — is not actually exercised. Consider keeping onPrompt pending and aborting the controller while it is unresolved (resolving onPrompt after the abort) so the test verifies the prompt can be closed mid-wait rather than after completion.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

message: "Paste the authorization code",
signal: controller.signal,
});
controller.abort();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: This test never aborts the signal while the manual-code prompt is still pending: onPrompt resolves immediately, then controller.abort() runs afterwards, so the aborted === true assertion is satisfied trivially by the test's own post-completion abort. The signal-forwarding check (callbackSignal === providerSignal) is valid, but the stated regression behavior — closing a still-open manual-code prompt when the localhost browser callback wins — is not actually exercised. Consider keeping onPrompt pending and aborting the controller while it is unresolved (resolving onPrompt after the abort) so the test verifies the prompt can be closed mid-wait rather than after completion.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/coding-agent/test/suite/regressions/lab-33-claude-oauth-prompt-abort.test.ts, line 20:

<comment>This test never aborts the signal while the manual-code prompt is still pending: onPrompt resolves immediately, then controller.abort() runs afterwards, so the `aborted === true` assertion is satisfied trivially by the test's own post-completion abort. The signal-forwarding check (`callbackSignal === providerSignal`) is valid, but the stated regression behavior — closing a still-open manual-code prompt when the localhost browser callback wins — is not actually exercised. Consider keeping onPrompt pending and aborting the controller while it is unresolved (resolving onPrompt after the abort) so the test verifies the prompt can be closed mid-wait rather than after completion.</comment>

<file context>
@@ -0,0 +1,48 @@
+					message: "Paste the authorization code",
+					signal: controller.signal,
+				});
+				controller.abort();
+				return {
+					type: "oauth",
</file context>

@eddieparc

Copy link
Copy Markdown
Contributor Author

All 14 checks are green. The LAB-33 regression, static checks, scoped OAuth tests, and real Orca/xterm.js QA passed. I attempted the required merge-commit merge, but GitHub denied MergePullRequest because the contributor account has no upstream merge permission. Maintainer merge requested.

@eddieparc

Copy link
Copy Markdown
Contributor Author

@code-yeongyu PR #663 is fully green (14/14 checks) and requires an upstream maintainer merge-commit. Normal merge is blocked by branch policy; auto/admin merge are denied to the contributor account. Please merge when available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant