Isolate innerdogfood ports and browser sessions per worktree - #605
Conversation
Deploying mouseterm with
|
| Latest commit: |
ed086d6
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://96c4e153.mouseterm.pages.dev |
| Branch Preview URL: | https://parallel-innerdogfood.mouseterm.pages.dev |
dormouse-bot
left a comment
There was a problem hiding this comment.
Two inline notes, plus two things outside the diff.
.claude/skills/debug-standalone-agent-browser/SKILL.md still tells its reader that validating a harness change means node --check standalone/scripts/dev-agent-browser.mjs and pnpm --filter dormouse-standalone build — the "Validation" section, under "After changing the harness, run:". This PR adds the suite that is now the real gate, and standalone/package.json's test script already picks it up through node --test scripts/*.test.mjs, so the skill points at the weaker check. Adding pnpm --filter dormouse-standalone test there closes it; happy to push that as a commit.
#493 (draft) edits the same startup block this PR rewrote, so it will conflict — and the conflict is not purely textual. It appends an OSC 367 serve announcement built from JSON.stringify({ port: vitePort, name: 'Dormouse dev', v: 1 }), read at module scope. Under this PR vitePort is the requested port, 0 by default, and the bound port only exists afterwards as vite.httpServer.address().port. A resolution that carries that line across verbatim announces port: 0 to every Dormouse terminal, and #493's test pins the payload shape rather than the value, so it stays green. Whichever lands second wants the announcement moved below startVite() and sourced from the actual listener.
|
Addressed the inline findings in ed086d6 and added pnpm --filter dormouse-standalone test to the debugging skill’s Validation section. The standalone suite and spec/loopback lints pass. Confirmed the overlap with draft #493. This PR does not yet emit OSC 367; I renamed its setting to requestedVitePort to distinguish the requested value (zero by default) from the bound listener. When the two PRs are combined, the serve announcement must move after await startVite() and use vite.httpServer.address().port; its regression test should assert a nonzero port matching the app URL. Carrying #493’s current startup line over unchanged would be incorrect. |
|
Both fixes hold up on a read of The On Nothing to add on #493 —
|
Running
pnpm innerdogfoodin two worktrees previously collided on fixed ports and reused the same browser session. The harness now binds OS-assigned ports and derives a stable browser identity from the canonical worktree path. Inside Dormouse,dor ensure -- pnpm innerdogfoodopens the worktree's browser pane automatically and prints its URL and browser command.Explicit port and session overrides remain supported. Vite runs in the harness process so startup uses its actual listener; failed startup and shutdown clean up the harness's own servers, sidecar, and browser launcher, including launchers that ignore SIGTERM. The spec and debugging instructions document the new workflow and avoid global browser cleanup.
Validation: