Skip to content

fix: auto-open browser for Claude CLI auth URL#110

Merged
bbsngg merged 2 commits intomainfrom
fix/claude-auth-browser-open
Mar 26, 2026
Merged

fix: auto-open browser for Claude CLI auth URL#110
bbsngg merged 2 commits intomainfrom
fix/claude-auth-browser-open

Conversation

@bbsngg
Copy link
Copy Markdown
Contributor

@bbsngg bbsngg commented Mar 26, 2026

Summary

  • Frontend received auth_url with autoOpen: true but never called openAuthUrlInBrowser() — browser never opened, CLI hung at "Paste code here"
  • Now auto-opens browser when autoOpen flag is set
  • Added "paste code here" as a server-side URL detection pattern for Claude CLI auth

Closes #106
Relates to #32

Test plan

  • Trigger Claude CLI auth from dr-claw UI
  • Verify browser auto-opens with the auth URL
  • Verify URL panel still shows as fallback for manual copy

🤖 Generated with Claude Code

bbsngg and others added 2 commits March 26, 2026 03:02
The frontend received auth URLs with autoOpen flag but never actually
opened the browser. Now openAuthUrlInBrowser() is called when
autoOpen is true. Also added "paste code here" as a detection pattern
so Claude CLI's auth prompt triggers URL forwarding.

Closes #106

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Verifies all detection patterns including the new "paste code here"
pattern for Claude CLI auth.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bbsngg
Copy link
Copy Markdown
Contributor Author

bbsngg commented Mar 26, 2026

Test Results ✅

Test Plan

  1. Unit test: shouldAutoOpenUrlFromOutput detects new "paste code here" pattern
  2. Unit test: All existing detection patterns still work
  3. Unit test: Unrelated output does not trigger false positives
  4. Code review: Frontend Shell.jsx correctly calls openAuthUrlInBrowser(data.url) when data.autoOpen === true
  5. Regression: Existing test suite passes

Results

Test Result
Detects "paste code here" (Claude CLI) ✅ Pass
Detects "paste code here" case-insensitively ✅ Pass
Detects "browser didn't open" ✅ Pass
Detects "open this url" ✅ Pass
Detects "continue in your browser" ✅ Pass
Detects "press enter to open" ✅ Pass
Detects "open_url:" prefix ✅ Pass
No false positives on unrelated output ✅ Pass
Frontend autoOpen logic verified (code review) ✅ Pass
Existing vitest suite (27 tests) ✅ Pass

Note: Frontend autoOpen behavior requires browser-based E2E testing for full verification. The code change has been verified via code review — openAuthUrlInBrowser(data.url) is called conditionally when data.autoOpen is truthy.

Test file added: test/auth-url-detection.test.mjs

@bbsngg bbsngg merged commit 226cdaf into main Mar 26, 2026
1 check passed
@bbsngg bbsngg deleted the fix/claude-auth-browser-open branch March 26, 2026 15:34
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.

Claude CLI auth: browser not launching, OAuth flow hangs

1 participant