Repository navigation
fix: [SDK-5583] open the served web page with the OS opener when no browser tool exists - #81
Conversation
abdulraqeeb33
left a comment
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
8de430a to
19bd7fe
Compare
…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.
19bd7fe to
adcaed7
Compare
One Line Summary
On web, when the session has no browser tool, the
verifyskill 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:4001and then asked for the subscription ID, and which introduces a lot of manual steps. The skill can open the tab itself:openon macOS,xdg-openon Linux,start "" <url>on Windows.Ticket: SDK-5583
Testing
python3 scripts/package_directory_bundle.py --check: pass.Affected code
skills/setup/SKILL.mdskills/credentials/SKILL.mdskills/verify/SKILL.mdscripts/references/