The server took a file named only .html for a page, which the desktop shows in the file panel, so tabs.open failed for want of a tab. A workspace address whose scheme or session ID was not in lower case named nothing, though the prefix it is compared with is written in lower case.
The server checks the path as it did for preview and sends the desktop the same preview action (navigate.path to move an existing tab). The permission check names the called operation and preview, so a deny of the old name still stops the path forms.
Conflict in chromium.ts reload(): keep the held-restore retry from browser-ext-fix and drop the second navigation interrupt, as browser-deep-snapshot does: every reload now arrives through execute, which interrupts once, and a second interrupt would skip a hard reload of a held restore.
Confirmation review, the gap I reported. If the browser plugin was
removed (plugins: ["-opencode.browser"]) after a crash left a grant,
the grant's skill "browser" allow outranked a person's deny or ask on
their own skill named browser. Nothing sweeps a grant once the plugin
is gone.
The skill rule was not needed. The experimental.rules hook already
hides the built-in skill while the session holds no browser grant or
its agent is denied the browser. Allowed agents get the skill from
their own rules: the default agent rules allow "*".
Now:
- An attachment writes only browser "*" allow (BrowserMachine.GRANT).
- isGrant still matches the old skill allow. A revoke, the
reconcile on attach and the startup sweep therefore remove grants
written by earlier versions. The configured rules the hooks read
still leave that allow out.
- The hook checks for the browser grant itself (holdsGrant), so a
leftover skill allow does not count as attached.
- With no skill rule in any grant, the evaluate hook's skill branch
and the hook's "configured skill deny" check are removed. Core's
own rules decide every skill. A configured skill deny or ask is
final again.
Tests:
- grant fixtures drop the skill rule. The startup-sweep test uses the
old two-rule grant and still revokes it.
- A machine test: an old grant is revoked in full and replaced with
the new one.
- The truth table and skill tests pass unchanged: with no skill rule
in the grant, the built-in skill is listed and loads for an allowed
agent with a desktop, and is hidden otherwise.
- New: with the plugin removed, a person's deny on their own browser
skill holds against a grant left behind. An old-version grant there
still outranks it, and the test pins that as the remaining case.
locate returned the file's real path. In a workspace reached through a link, as macOS's tmpdir under /private is, that path lies outside the workspace's spelling: preview asked again for it, and the tool sent the desktop a ../../private path. It now names the physical file under the workspace as the session spells it and asks only when a link inside the workspace points elsewhere in it.
The server and the desktop each had their own extension-URL pattern, refusal message and localhost rule. They drifted: the server sent app.localhost:3000 to https while the address bar used http, and it missed blob: URLs of an extension. @opencode/plugin-browser/rpc now exports extensionOrigin, extensionPageRefusal and loopbackAddress, and both sides use them.
evaluate with a top-level await and no return, such as 'await fetch(x).then(r => r.status)', ran as an async function body and returned null; it now runs as the returned expression first. Element and URL waits checked their deadline only between probes, so a page in a long task held a 1 s wait for the 60 s request timeout and ended as [browser.timeout]; each probe is now cut at the deadline and cancelled on the desktop, and the wait returns met: false.
The server recognised a wait timeout, a changed document and a stale ref by matching the desktop's English messages. The desktop now sends codes for them (condition_unmet, document_changed, stale_ref) in the failure's existing code field, the server keeps the code on the Tool.Error, and the text matching is gone. An older desktop sends operation_failed, so an unmet wait then fails as it did before this branch.
A call that a tool.use policy blocks, or whose ask was not answered yet, could learn up to ten open tab IDs and URLs from the tab_unavailable message, and probe server paths through preview. Every tool now refuses configured denies, checks only its own input, requires an attached desktop ([browser.disconnected], which names no tab), runs the full permission check, and only then looks up the tab or the file. Without a desktop, preview names the path it was given without checking it.
An agent core cannot resolve, such as a disabled or removed one, now gets core's deny-all here too, so the attachment's grant no longer gives it the browser.
The wait plan carries what it waited for, the second tab lookup for wait is gone, and a pause reports waited: delay to match condition: delay.
The deny check only refused a call when the last rule for `browser` denied every
operation. A deny on one operation (for example `browser` on `tabs.open` or
`files.*`) and a configured `ask` still went through: the permission check
evaluates the session's `browser:* allow` grant after them, so the grant won and
answered silently.
The plugin now registers a `permission.evaluate` hook for the `browser` action.
It picks the rule for the call's operation from the agent's configured rules
and the session's rules without the grant, the way core's Permission.evaluate
picks it (last match on action and resource patterns). A deny refuses the call
with `[browser.denied]`, naming the operation when the deny is for one
operation. An ask makes the permission check prompt as it would without the
grant. No matching rule leaves the call allowed by the grant with no prompt.
Later hooks such as tool.use policies still apply. The matcher copies core's
Wildcard.match; a core test checks both pick the same rule.
Tool listing is unchanged.
wait({ tabID, timeout }) with no condition key was a load wait, which returns at once on a loaded page; the 21 such calls in the data were attempted pauses. A lone timeout or timeoutMs now pauses for that long, capped at 30 s; wait({ tabID }) still waits for load. Results carry waited (load, text, textGone, element, elementGone, url or pause). The description also states that time up to 60 counts as seconds.
The skill and tool descriptions now show evaluate with return and await, wait with its implied conditions, met: false and delayMs, preview as the way to show a local HTML file, and what to do on disconnected and tab_unavailable errors. Optional parameters such as tabs.open focus, frameID and limit had descriptions the model never saw: optional() does not carry annotations to the encoded JSON Schema, so they now sit on the inner schema.
preview acknowledged dispatch before the pane opened anything, so a path that existed nowhere returned success (#61625). The server now resolves the path the way the Review pane does (workspace-relative or absolute, file:// URLs, :line and #L suffixes, and the one workspace file whose path ends with it) and fails with the resolved path when no file is there or it is a folder. Without a desktop app, preview now says the file was not shown and gives its absolute path for the model to pass to the user, instead of the generic disconnected advice (28 of the 38 disconnected errors on this machine were previews).
- A session with no desktop no longer says 'Repeating browser actions while disconnected will not help' (#55795): it says the browser runs in the desktop app, to tell the user, and to continue without it until they open the session there.
- A closed or foreign tabID lists the session's open tabs (at most ten), so the next call can use one.
- A local path or file: URL passed to tabs.open or navigate is named and answered with browser.preview({ path }) or serving it over HTTP; other invalid URLs are named too.
- The reconnect advice no longer asks the model to reconnect the desktop, which it cannot do.
browser.wait without condition was 2,138 of 3,099 browser errors across four devices. Models write Playwright-style keys: text with timeout, state, selector, url, time, ms. wait now reads the condition from whichever key is present (none means load), accepts timeout for timeoutMs, shortens waits above 30 s instead of rejecting them, pauses for delayMs, time or ms, and polls for a selector, ref or URL from the server with actions every desktop already supports. A condition that does not hold in time returns met: false with what the page showed instead of throwing. Waits also no longer fail when the document changed since the server last saw the tab.
Models passed expression (and code) where evaluate required script; every such call failed. Scripts with a top-level return or await failed with a SyntaxError in the page. The server now folds expression and code into script, and sends a script that does not compile as a classic script but does as an async function body as (async () => { ... })(). Scripts that compile today reach the page unchanged.
A key the schema did not declare was dropped silently: input repair deletes undeclared keys of a closed object, and Effect structs ignore excess keys. A call such as evaluate({ tabID, expression }) then failed with 'script: Missing key' and no hint that expression was the problem. Every browser tool now fails with 'Not a parameter of browser.X. Valid parameters: ...'.
Attaching a desktop browser writes browser:* and skill:browser allows into the
session's permissions. Session rules are evaluated after agent rules, so the
grant overrode a browser deny from config, an agent definition (for example a
"*" deny) or the session itself. Browser tools never called the permission
check either, so tool.use policies did not apply.
The plugin now records each agent's rules before it appends its own default
deny. A browser call is refused when those rules, plus the session's rules
without the grant, deny the browser, decided the way core's tool filter decides.
The call then runs the permission check with the operation as its resource, so
permission.evaluate hooks such as tool.use policies apply. Sessions without a
deny behave as before: the grant allows the check, so nothing prompts.
Refs #54044, #53294, #56869