opencode/packages
Luke Parker be740a5d01 fix(browser): revoke attach grants left behind by a server that was killed
The attach grant is a stored session rule, but its revoke runs only from the
plugin's finalizer. After SIGKILL, a crash or a stop timeout, the session kept
browser:* and skill:browser allows with no attachment behind them, so the next
server listed the browser tools and every call failed with
[browser.disconnected].

Each grant is now recorded in plugin storage with the server process that wrote
it (host and process ID) and its location, before the grant is written; a
successful revoke removes the record. When the plugin starts for a location, and
before it registers the browser RPC so no attach can race it, it revokes the
grants recorded for that location by a process that no longer runs.

Several server processes can share one database (a desktop's server and a
manual `opencode serve` both use opencode.db), so a sweep of every session in
the location could revoke another server's live grant. The sweep skips records
of a running process and of another host, which cannot be checked. Grants
written before this change have no record and are left alone; the next attach
and detach of their session removes them.

The startup sweep before RPC registration, its location scoping and ignoring
per-session failures come from #61639.

Fixes #61609

Co-authored-by: Chen Yufeiyang <fei76161@gmail.com>
2026-11-13 08:25:22 +10:00
..
ai fix(ai): accept System One refusals and send PDFs in the OpenRouter state (#63443) 2026-11-12 03:00:45 +00:00
app fix(app): order Recent sessions by the last list reload and drop the rename guard (#63370) 2026-11-12 13:45:04 -05:00
cli feat(core): run local Windows shell commands in the process daemon (#63409) 2026-11-11 18:32:15 -05:00
client fix(tui): drop tool-result image bytes from the transcript store unless image previews are on (#63577) 2026-11-12 15:17:44 -06:00
codemode fix(codemode): decode UTF-8 across chunk boundaries (#63600) 2026-11-12 20:30:06 +00:00
core fix(browser): revoke attach grants left behind by a server that was killed 2026-11-13 08:25:22 +10:00
data refactor(site): put every neutral grey on one shared scale (#63604) 2026-11-12 20:57:16 +00:00
desktop chore: remove beta what's new and visual svgs (#63325) 2026-11-11 12:40:39 -05:00
effect-drizzle-sqlite/examples/migrations/20240101000000_create_users chore: move the data site off sst 2026-11-10 22:46:25 -05:00
gui-plugins fix(app): advance SSH prompts and close the dialog on connection (#63544) 2026-11-12 15:14:43 +00:00
http-recorder chore: move the data site off sst 2026-11-10 22:46:25 -05:00
httpapi-codegen chore: move the data site off sst 2026-11-10 22:46:25 -05:00
identity
latex release: v2.2.7 (#63085) 2026-11-10 04:49:26 -06:00
merman release: v2.2.7 (#63085) 2026-11-10 04:49:26 -06:00
nav-menus refactor(site): put every neutral grey on one shared scale (#63604) 2026-11-12 20:57:16 +00:00
patchmark release: v2.2.7 (#63085) 2026-11-10 04:49:26 -06:00
plugin fix(core): keep plugin swaps going when a cleanup fails (#63548) 2026-11-12 16:15:41 +01:00
plugin-browser fix(browser): revoke attach grants left behind by a server that was killed 2026-11-13 08:25:22 +10:00
plugins chore: drop the sst-env.d.ts files sst regenerated 2026-11-10 23:08:08 -05:00
process-daemon chore(process-daemon): release 0.5.2 (#63381) 2026-11-11 15:03:21 -05:00
protocol feat(core): publish MCP events on the bus (#63261) 2026-11-11 21:41:31 -06:00
schema feat(core): publish MCP events on the bus (#63261) 2026-11-11 21:41:31 -06:00
script chore: move the data site off sst 2026-11-10 22:46:25 -05:00
sdk feat(core): tell agents when they are in a fork (#63235) 2026-11-11 08:41:50 +01:00
server feat(core): run local Windows shell commands in the process daemon (#63409) 2026-11-11 18:32:15 -05:00
session-ui fix(session-ui): keep links whose label contains inline code (#63587) 2026-11-12 13:51:17 -05:00
simulation release: v2.2.7 (#63085) 2026-11-10 04:49:26 -06:00
stories chore: move the data site off sst 2026-11-10 22:46:25 -05:00
theme chore: move the data site off sst 2026-11-10 22:46:25 -05:00
tui fix(tui): drop tool-result image bytes from the transcript store unless image previews are on (#63577) 2026-11-12 15:17:44 -06:00
ui feat(session-ui): maximize Mermaid diagrams to zoom and pan them (#59250) 2026-11-12 15:02:33 +00:00
util fix(session): measure tps from the first streamed token (#63321) 2026-11-11 10:32:49 -05:00