Skip to content

fix: [SDK-5583] open the served web page with the OS opener when no browser tool exists - #81

Merged
sherwinski merged 3 commits into
sherwin/sdk-5576from
sherwin/sdk-5583
Oct 22, 2026
Merged

sherwinski merged 3 commits into
sherwin/sdk-5576from
sherwin/sdk-5583

Conversation

@sherwinski

@sherwinski sherwinski commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

One Line Summary

On web, when the session has no browser tool, the verify skill opens the served URL in the user's default browser with the OS opener before it asks the user for anything.

Motivation

During recent testing of the web flow with Claude Code on a Vite app, Vite does not open a tab. The skill told the user to open https://localhost:4001 and then asked for the subscription ID, and which introduces a lot of manual steps. The skill can open the tab itself: open on macOS, xdg-open on Linux, start "" <url> on Windows.

Ticket: SDK-5583

Testing

  • python3 scripts/package_directory_bundle.py --check: pass.
  • The portability grep from AGENT.md: no output.

Affected code

  • skills/setup/SKILL.md
  • skills/credentials/SKILL.md
  • skills/verify/SKILL.md
  • scripts/
  • references/

@sherwinski
sherwinski added this pull request to stack #67 October 20, 2026 23:42

@abdulraqeeb33 abdulraqeeb33 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving. The once-per-run rule and the poll-loop change line up, and the http/https guard is a good limit on what gets opened. One Windows question inline.

- **Without a browser tool, open the page in the user's default browser yourself** before you ask them for anything: Vite and most dev servers do not open a tab on their own, and a user who sees only a URL in the chat has to notice it and open it. Run the OS opener on the served URL, once per run, after the pass condition above holds:
- macOS: `open <url>` — or `open -a "Google Chrome" <url>` when the URL is a `localhost` origin and Chrome is installed.
- Linux: `xdg-open <url>`.
- Windows: `cmd /c start "" <url>` — the one form that works from `cmd.exe`, PowerShell, and Git Bash; the `""` is the window-title argument that `start` consumes first.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Worth confirming on Windows before relying on the Git Bash claim. Claude Code on Windows runs commands through Git Bash, and MSYS path conversion is known to rewrite a lone /c to C:/, which leaves cmd open as an interactive shell instead of running start. I haven't reproduced it. If it happens, cmd //c start "" <url> or MSYS_NO_PATHCONV=1 avoids it. Also, SKILL.md:81 and :121 give the shorthand cmd /c start without the "", so an agent that stops at SKILL.md runs a different form than this line recommends.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Willing to defer on this for now. I also think agents can understand intent of an instruction, even if the explicit instruction itself may be incorrect.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The 2 shorthand mentions in SKILL.md now say cmd /c start "", the same form as this line (19bd7fe). The MSYS path-conversion question stays deferred.

…rowser tool exists

Vite and most dev servers do not open a tab, and without a browser tool
the verify skill told the user to open the URL themselves and then asked
for the subscription ID. Part A → Web now runs the OS opener (`open`,
`xdg-open`, `start "" <url>`) on the served URL before any ask, once per
run, and falls back to the manual instruction only when the opener is
missing, fails, or the host blocks it. The step 1 run bullet, the step 2
no-key ask, the poll-loop reminder, and the inputs table say the same.
… conditional step-2 ask

- Windows uses `cmd /c start "" <url>`, which works from cmd.exe,
  PowerShell, and Git Bash; the bare `start ""` form fails in PowerShell.
- When the URL is a localhost origin, the agent tells the user the page
  must be in Chrome or Edge, because only Chromium treats localhost as a
  secure origin for push; on macOS it can target Chrome with `open -a`.
- The opener runs after the pass condition and only on an http(s) URL
  the dev server printed.
- The step 2 no-key ask includes the URL when the opener fell back.
Both mentions in the verify skill now say the same command as
platform-verification.md, with the empty window-title argument.
@sherwinski
sherwinski merged commit 9432d3b into main Oct 22, 2026
10 checks passed
@sherwinski
sherwinski deleted the sherwin/sdk-5583 branch October 22, 2026 20:52
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.

2 participants