Skip to content

fix(web): one-line warning when the browser opener cannot start - #2689

Merged
cliffhall merged 1 commit into
v2/mainfrom
v2/fix/2645-web-open-error-one-line
Oct 12, 2026
Merged

cliffhall merged 1 commit into
v2/mainfrom
v2/fix/2645-web-open-error-one-line

Conversation

@cliffhall

Copy link
Copy Markdown
Member

Closes #2645

What changed

openBrowser (clients/web/server/web-server-config.ts) passed the whole error to console.warn, so when --web could not spawn the opener it printed a stack trace plus spawnargs — which carry the launch URL with the API token. It now prints the message only, in the same wording the CLI already uses (core/cli/cli-oauth-navigation.ts):

Could not open a browser automatically (spawn open ENOENT). Open the URL above manually.

Tests

server-auto-open.test.ts now asserts the exact one-line warning; the ENOENT case uses an error shaped like the real one (with a tokenized spawnargs) and asserts the token does not reach the warning; a new case covers a non-Error rejection.

Verification

  • npm run local:gate green.
  • The issue's repro against the built launcher (env -i PATH=/var/empty MCP_AUTO_OPEN_ENABLED=true node clients/launcher/build/index.js --web) now prints exactly the line above — no stack, no spawnargs.

No UI change, so no screenshots.

🤖 Generated with Claude Code

…rt (#2645)

openBrowser logged the whole error object, so a missing opener printed a
stack plus spawnargs carrying the tokenized launch URL. Print the message
only, in the CLI's wording.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: cliffhall <[email protected]>
@cliffhall cliffhall added the v2 Issues and PRs for v2 label Oct 12, 2026
@cliffhall
cliffhall requested a balanced review from Copilot October 12, 2026 18:07

Copilot AI 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.

🟢 Approval recommended

The implementation matches the issue requirements and is thoroughly covered by focused tests.

0 open findings

What changed in this PR

Prevents browser-opener failures from logging stack traces and token-bearing spawn arguments, addressing #2645.

Changes:

  • Logs only the normalized failure message.
  • Adds coverage for Error, non-Error, and token-bearing spawn failures.
File Description
clients/​web/​server/​web-server-config.ts Emits a concise, single-argument warning.
clients/​web/​src/​test/​integration/​server/​server-auto-open.test.ts Verifies warning output, token omission, and server resilience.

🧠 Review effort: Balanced


💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@cliffhall

Copy link
Copy Markdown
Member Author

Copilot review closed: round 1 was clean (0 inline comments, no headline findings, no suppressed comments).

@cliffhall
cliffhall merged commit 571593a into v2/main Oct 12, 2026
8 checks passed
@cliffhall
cliffhall deleted the v2/fix/2645-web-open-error-one-line branch October 12, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Issues and PRs for v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Web launcher prints the whole spawn error object when the browser opener cannot start

2 participants