Skip to content

PLANNOTATOR_BROWSER=none opens nothing - #1940

Merged
backnotprop merged 5 commits into
mainfrom
browser-none-opens-nothing
Oct 15, 2026
Merged

backnotprop merged 5 commits into
mainfrom
browser-none-opens-nothing

Conversation

@backnotprop

@backnotprop backnotprop commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Follows #1938 (merged); this branch has main merged in.

What changes

A "none" value on PLANNOTATOR_BROWSER, or --browser, which sets it: none, false, 0, off, no, true, 1 or : (trimmed, any case), now opens nothing at all, local or remote:

  • no VS Code IPC
  • no Glimpse window
  • no BROWSER
  • no system opener (open, xdg-open, start)

Since #756 these values were read as "unset", so PLANNOTATOR_BROWSER=none opened the system default, ran BROWSER when it was set, or opened Glimpse. Before #756 every one of them opened nothing. This was seen in #1923, where our own tests opened real tabs.

Instead of opening, the session says why, once:

  Plannotator session ready: http://localhost:54321
  Not opening a browser (PLANNOTATOR_BROWSER=none).

Pi shows the same sentence in its "opened" message, and in the after-turn notice for callers that have no opened message.

BROWSER is unchanged. Hosts set it for their own reasons (Claude Code's agent view sets BROWSER=true), so its #756 values (true, false, none, 0, 1, :) are still read as unset and the default chain runs.

Value PLANNOTATOR_BROWSER / --browser BROWSER
unset or empty Default chain Same
none false 0 off no true 1 : Open nothing anywhere Ignored (#756), default chain
app name, path or script As today As today

How

  • New packages/shared/browser-intent.ts, vendored to Pi: resolveBrowserIntent(env) returns none, default or explicit. One rule for both runtimes.
  • Bun packages/server/browser.ts: openBrowser returns false at once for none and prints the reason line (so the Inbox, sessions --open and t3 login follow it too); shouldTryRemoteBrowserFallback asks VS Code only for the default chain. handleServerReady prints the reason under the ready line and never calls the opener, so no "Could not open a browser" line follows. A host that opens the browser itself (PLANNOTATOR_SKIP_BROWSER_OPEN) gets no reason line.
  • sessions --open no longer says "Opened … in browser" when nothing opened.
  • Pi apps/pi-extension/server/network.ts: openBrowser returns { opened: false, notOpening } for none, local or remote; sessionOpenedMessage and the after-turn notice show the sentence; a choice to open nothing is never reported as a failed launch.

Changes users will notice

  1. The values above on PLANNOTATOR_BROWSER or --browser open nothing, including for the Inbox and sessions --open. --browser none is now the per-run "don't open" switch.
  2. In remote mode on Bun, those values no longer try VS Code IPC or the remote host's opener.

Unchanged: BROWSER=true from Claude Code's agent view still opens a browser; app names, paths and scripts work as before; Glimpse stays the default.

Tests

  • packages/shared/browser-intent.test.ts: the table for every value, BROWSER's fix(browser): treat no-op BROWSER values as unset so headless sessions can fall back #756 values, explicit handlers, and the approved list exactly. Each sentinel line carries no-browser-guard: sentinel under test.
  • packages/server/browser-intent-launch.test.ts (Bun) and apps/pi-extension/server/browser-intent-launch.test.ts (Pi): a child process with an explicit environment (nothing inherited), a scratch data dir, and a PATH holding only stand-in open, xdg-open and glimpseui scripts that log their calls. On Bun a VS Code IPC registry points at a recording server in the test. Asserts nothing launches for PLANNOTATOR_BROWSER=none with BROWSER=<script>, local and remote, and that BROWSER=true still launches the default opener (Bun remote: still asks VS Code). Checked that both fail when the "none" rule is switched off.
  • packages/server/shared-handlers.test.ts: exact bytes of the ready line plus the reason line, local and remote; the opener is never called; no reason line with skipBrowserOpen.
  • packages/server/browser.test.ts: the remote case now expects no IPC for none.
  • apps/pi-extension/plannotator-browser.test.ts: the opened message and the after-turn notice say why; no failure notice.
  • tests/no-browser-sentinel.test.ts still passes: tests keep using NO_BROWSER, since older binaries (the version matrix) still read a sentinel as unset. Its comments and the Testing Rules bullet now say so.

Ran: bun run typecheck; bun test packages/server apps/hook/server packages/shared tests apps/opencode-plugin packages/t3-code (4456 pass); bun test in apps/pi-extension (542 pass). No test opened a browser.

Docs

CLAUDE.md (the PLANNOTATOR_BROWSER row and the Testing Rules bullet); marketing environment-variables, configuration, remote-and-devcontainers, troubleshooting; the plannotator skill's environment table; the root, hook, OpenCode, Codex, Gemini and Copilot READMEs and portal/ANNOTATE.md. Release notes are left for the release.

backnotprop and others added 5 commits October 15, 2026 11:57
Every Bun session now writes one stable stderr line on start, before it
launches a browser:

  Plannotator session ready: <url>

Remote forwarding advice and a failed browser launch become follow-up lines
under it, so the URL appears exactly once. A local session whose browser
opened fine used to print nothing (#1134), and a launcher that never exits
hid the URL until it did.

- shared-handlers: SESSION_READY_LINE_PREFIX, an `announce` option, the line
  printed before the launch; isCodexDesktopHost removed (its case is covered).
- --tailscale: announceTailscaleSession prints the ready line once, then the
  tailnet line and QR.
- OpenCode embedded runtime: announce: false (its toast or transcript notice
  carries the URL); an OpenCode 2 host without session.synthetic logs the URL
  instead. The CLI bridge's stderr filter also forwards the remote follow-up
  and the "Could not open a browser" line.
- Pi: the in-turn "opened" message always carries the URL; the after-turn
  notify runs only for the archive and the event API, or after a failed
  launch (remote no longer shows the URL twice).

Re-applies the design of #1184 by @technicalpickles on current main.

Co-authored-by: Josh Nichols <[email protected]>
A "none" value on PLANNOTATOR_BROWSER (or --browser): none, false, 0, off,
no, true, 1 or :, trimmed and any case, now opens nothing at all, local or
remote: no VS Code IPC, no Glimpse, no BROWSER, no system opener. Since #756
these values were read as "unset" and opened the system default (or ran
BROWSER, or Glimpse), so there was no way to say "never open".

The rule lives in one module, packages/shared/browser-intent.ts
(resolveBrowserIntent: none | default | explicit), vendored to Pi. Bun's
openBrowser and shouldTryRemoteBrowserFallback and Pi's openBrowser use it,
so every caller follows it (sessions, the Inbox, sessions --open, t3 login).
The Bun CLI prints "  Not opening a browser (PLANNOTATOR_BROWSER=none)."
under the ready line; Pi says it in its opened message. BROWSER keeps #756:
its no-op values are still ignored and the default chain runs, because hosts
set it (Claude Code's agent view sets BROWSER=true).

Tests: a pure table for the intent; one process test per runtime whose PATH
holds only stand-in open, xdg-open and glimpseui scripts (and a recording
VS Code IPC server on Bun), proving nothing launches for none (BROWSER set,
local and remote) and that BROWSER=true still runs the default opener.
…thing

# Conflicts:
#	apps/opencode-plugin/server.ts
#	apps/pi-extension/plannotator-browser.test.ts
#	apps/pi-extension/plannotator-browser.ts
#	apps/pi-extension/session-opened.ts
#	packages/server/shared-handlers.test.ts
@backnotprop
backnotprop changed the base branch from session-url-always to main October 15, 2026 16:53
@backnotprop
backnotprop merged commit 826a8bc into main Oct 15, 2026
44 of 45 checks passed
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.

1 participant