mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-29 11:42:17 +00:00
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> |
||
|---|---|---|
| .. | ||
| ai | ||
| app | ||
| cli | ||
| client | ||
| codemode | ||
| core | ||
| data | ||
| desktop | ||
| effect-drizzle-sqlite/examples/migrations/20240101000000_create_users | ||
| gui-plugins | ||
| http-recorder | ||
| httpapi-codegen | ||
| identity | ||
| latex | ||
| merman | ||
| nav-menus | ||
| patchmark | ||
| plugin | ||
| plugin-browser | ||
| plugins | ||
| process-daemon | ||
| protocol | ||
| schema | ||
| script | ||
| sdk | ||
| server | ||
| session-ui | ||
| simulation | ||
| stories | ||
| theme | ||
| tui | ||
| ui | ||
| util | ||