You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Session reachability: always surface the review URL, and keep the port stable across plan resubmissions #1134
Two small gaps make a running Plannotator session hard to reach. Both were reported separately (#601, #589) and both are still current on main. This issue supersedes both.
1. The URL is only printed when the browser fails.handleServerReady (packages/server/shared-handlers.ts:209-228) writes the session URL to stderr only when the session is remote, when the Codex desktop host is detected, or when openBrowser() fails. On the common local path where the browser opens fine, nothing is printed, so there is no way to recover the URL if the tab is closed, if you are on a second machine, or if you want to hand it to another tool.
2. The port changes on every resubmission.getServerPortConfiguration (packages/server/remote.ts) returns port 0 for local sessions, so each deny, revise, resubmit cycle spawns a new process on a new random port. Anyone pointing a secondary tool or a bookmark at the session has to be re-told the port every round. PLANNOTATOR_PORT is the only workaround today, and #1042's bounded ranges do not address it (a range still picks a different free port each start).
Acceptance criteria
The session URL is written to stderr on every session start, including local sessions where the browser opened successfully.
Within one plan review cycle (same project and plan slug), a resubmitted plan reuses the previous session's port when it is still free, without requiring PLANNOTATOR_PORT.
plannotator sessions continues to list and reopen these sessions unchanged.
Out of scope: the portless / stable-hostname idea from #601. That is a much larger proxy story; open it separately if wanted.
Related: #899 (big-picture session tracker), #1042 (bounded port ranges, merged).
Ran into both halves of this and figured the usage data might be worth adding, since it's all still current on main (0935cf08).
I went back through my Claude Code transcripts and found 16 sessions where I'd used plannotator annotate. Across those, the agent burned 21 lsof calls hunting for the bound port, 8 polling loops grepping its own background output for anything matching https?://, 6 pkill -9 -f plannotator calls, and 4 curl probes against 127.0.0.1:$port to work out which document a given server was actually serving. Meanwhile I'm typing "i need a url", then "ill need the url", then eventually "you need to give me a URL for it."
None of that was the agent flailing. There was genuinely no URL anywhere for it to read.
Confirming criterion 1 is still unmet: handleServerReady (packages/server/shared-handlers.ts:209-231) writes a URL on exactly three paths, isRemote, isCodexDesktopHost(), and !opened. A local session where the browser opened fine gets silence, and that's the common case.
One thing that might shorten the fix: the side channel already exists. PLANNOTATOR_READY_FILE appends {url, isRemote, port} the moment the server binds, and apps/amp-plugin/plannotator.ts:543 sets it. apps/hook/ never does, so Claude Code is the one host that can't see a URL that's already being published. Wiring it there gets you most of criterion 1 for the Claude Code path without touching the stderr behavior at all. I'd still want the stderr line for people not going through a plugin, though.
Criterion 2 is what the pkill calls were about. A stale server holding the previous document, with no way to tell from the outside which one it had, so kill-and-relaunch was the only reliable move. #636 is circling the same thing from the tab side.
This is exactly the kind of usage data that turns a "nice to have" into a priority, thank you for pulling the transcripts. Twenty-one lsof calls and six pkill -9 invocations to find a URL the server already knows is a clear verdict on the current behavior.
It is unclaimed and it is yours if you want it. Your read of the shortest path matches ours:
Wire PLANNOTATOR_READY_FILE in apps/hook/ the way apps/amp-plugin/plannotator.ts already does, which closes most of criterion 1 for Claude Code without touching stderr behavior.
Add the unconditional stderr URL line in handleServerReady for people not going through a plugin. Keep it one line and stable in format, since agents will grep it.
Two repo rules worth knowing before you start: server changes must land in both runtimes (packages/server/ for Bun and apps/pi-extension/server/ for the Node mirror; shared logic goes in packages/shared/ and gets vendored via vendor.sh), and criterion 2 (stable port across resubmissions) has some subtlety around abandoned-session cleanup, so feel free to split it into a second PR if it grows. Happy to review as soon as something is up.
Activity
technicalpickles commentedon Aug 3, 2026
Ran into both halves of this and figured the usage data might be worth adding, since it's all still current on main (
0935cf08).I went back through my Claude Code transcripts and found 16 sessions where I'd used
plannotator annotate. Across those, the agent burned 21lsofcalls hunting for the bound port, 8 polling loops grepping its own background output for anything matchinghttps?://, 6pkill -9 -f plannotatorcalls, and 4curlprobes against127.0.0.1:$portto work out which document a given server was actually serving. Meanwhile I'm typing "i need a url", then "ill need the url", then eventually "you need to give me a URL for it."None of that was the agent flailing. There was genuinely no URL anywhere for it to read.
Confirming criterion 1 is still unmet:
handleServerReady(packages/server/shared-handlers.ts:209-231) writes a URL on exactly three paths,isRemote,isCodexDesktopHost(), and!opened. A local session where the browser opened fine gets silence, and that's the common case.One thing that might shorten the fix: the side channel already exists.
PLANNOTATOR_READY_FILEappends{url, isRemote, port}the moment the server binds, andapps/amp-plugin/plannotator.ts:543sets it.apps/hook/never does, so Claude Code is the one host that can't see a URL that's already being published. Wiring it there gets you most of criterion 1 for the Claude Code path without touching the stderr behavior at all. I'd still want the stderr line for people not going through a plugin, though.Criterion 2 is what the
pkillcalls were about. A stale server holding the previous document, with no way to tell from the outside which one it had, so kill-and-relaunch was the only reliable move. #636 is circling the same thing from the tab side.Happy to take a swing at this if it's unclaimed.
backnotprop commentedon Aug 3, 2026
This is exactly the kind of usage data that turns a "nice to have" into a priority, thank you for pulling the transcripts. Twenty-one
lsofcalls and sixpkill -9invocations to find a URL the server already knows is a clear verdict on the current behavior.It is unclaimed and it is yours if you want it. Your read of the shortest path matches ours:
PLANNOTATOR_READY_FILEinapps/hook/the wayapps/amp-plugin/plannotator.tsalready does, which closes most of criterion 1 for Claude Code without touching stderr behavior.handleServerReadyfor people not going through a plugin. Keep it one line and stable in format, since agents will grep it.Two repo rules worth knowing before you start: server changes must land in both runtimes (
packages/server/for Bun andapps/pi-extension/server/for the Node mirror; shared logic goes inpackages/shared/and gets vendored viavendor.sh), and criterion 2 (stable port across resubmissions) has some subtlety around abandoned-session cleanup, so feel free to split it into a second PR if it grows. Happy to review as soon as something is up.feat(server): always surface the session URL
fix(opencode,pi): stop the session-ready line from breaking both TUI …
fix(server): print the tailnet ready line once, pin the stdout contract
Every session prints its URL (re-applies #1184) (#1938)
PLANNOTATOR_BROWSER=none opens nothing (#1940)