Repository navigation
Conversation
A run command's URL opened only when the command exited 0, and the commands it is used with are dev servers (npm run dev, npm start, node serve.js) that never exit, so the URL never opened. It now opens once, on whichever comes first: - a loopback URL starts accepting TCP connections while the run is alive (polled every 500ms for up to 2 minutes, every address of the host in parallel, since localhost is both ::1 and 127.0.0.1); - the run exits 0, which is the old rule, kept for one-shot commands. Remote URLs and SSH parents keep the exit-0 rule only. A remote URL is reachable before a deploy finishes, and an SSH run's server listens on the remote machine's loopback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a session command has a URL, it never opens in the browser. The URL was opened only when the command exits 0, but these commands are almost always dev servers, which never exit. All five run commands with a URL in the reporter's
state.jsonare servers:npm run dev,npm start,node tools/serve.js 8084,node tools/studio.jsand apreview.ps1.crash.loghas noPostRunUrlentries, so the URL was never rejected. The code to open it simply never ran.Fix
The URL now opens once, on whichever happens first:
localhostresolves to::1and127.0.0.1, and a server usually binds only one of them. Trying them one after the other doesn't work on Windows, where a refused loopback connect takes about 2 s; the test against a real IPv4-only listener caught exactly that.The watcher stops on exit, Stop and Dispose, and a stopped run never opens late. Remote URLs and SSH parents are never polled:
The validation of the URL (http or https only) and the rule of launching the validated string are unchanged.
The dialog tooltip and
CLAUDE.mddescribe the new rule.Tests
New
PostRunUrlReadinessTests(19 cases):127.0.0.1and::1, reached aslocalhostand0.0.0.0, plus a port with nothing listening.The full unit suite passes: 1203 of 1203.
Manual check
npm run devandhttp://localhost:5173: press ▶. The browser opens when Vite is up, not before, and only once.🤖 Generated with Claude Code