The registry is in the workspace-only SDK, but a registry is its id, so a plugin bundle could add a gate under it, hold every prompt and command and learn the session of each. The host now asks the gates of plugins that ship with the app and no other. The cap drops from two seconds to one: a gate that misses it costs the model one step without what the gate prepared.
core/src/tool.ts: dev renamed Code Mode's location switch to full host globals (Bun.file, Bun.write, Bun.Glob, #64518); the catalog cache stays keyed by visible tool names, now with that switch. session-ui markdown.tsx: dev's wrap default and our app-link flag both reach updateBlock.
BuiltinPromptGate: the host waits for every gate, for at most two seconds, after the server created the session and before the prompt or command request goes out. The prompt already shows meanwhile.
Conflicts with dev's device toolbar (#63819), text file tabs (#64463), the new icon set (#64466) and the Code Mode split (#64487, #64510):
- chromium.ts: dev's viewport writer, device emulation and per-page reports, with our retry-only detail; pointer commands run in the writer's queue inside our refusal and passkey wrapper; captures share the queue, and a fixed viewport is captured through the device's CDP clip while Auto keeps the fresh-redraw path.
- panel.tsx: dev's device toolbar, preview frame and spotlight, with our extensions menu, options menu (data-browser-popup), prompt-aware native view, error pages and two-view site popover; our page area box is declared again.
- embeds.tsx: our measure and place split and layout spine observers, with dev's scrollport clip in the shown test, the cover rect and the layout key.
- model.ts, pane.ts, ipc users, keys.ts (find previous stays claimed), i18n, fixtures and tests keep both sides.
- artifact-view.tsx: dev's fixed modes; desktop HTML stays source only.
- codemode: a removed tool's sentence is returned as dev's unknown-tool failure; core tool.ts keys the catalog cache by visible names and whether Node's path is on.
- icons: dev's set, our puzzle icon.
Adds a puzzle glyph to the icon catalog (16 px grid, 1 px stroke, round joins, like its neighbours) and uses it for browser extensions only: the pane's Extensions button and the fallback of an extension without its own icon in the toolbar menu, Settings > Browser and the Add an extension dialog. OpenCode's own extensions keep their icon.
Conflicts: protocol experimental group and server handlers keep dev's blob endpoint and our preview read; fs.ts takes dev's ByteRange, which preview.ts now uses; permission.ts keeps our Permission.rules evaluation and gains dev's nested call rows; client and OpenAPI output regenerated.
Confirmation review, low finding. All hooks shared one event.deny
array, so a later hook could drop an earlier hook's denies, for
example with event.deny.length = 0, or replace the array.
Now event.deny is a function that appends to a list owned by core.
The event object is frozen, so a hook cannot swap deny, rules or
session. No hook can read, clear or reorder the list. Core decodes the
list as before, and a malformed entry still fails closed with a
message that names the hook. Denies still apply in the order the
hooks add them.
Tests: a later hook that tries to replace deny fails to and cannot
undo the earlier deny. The first test now checks that swapping rules
and session fails.
Review finding M1. An experimental.rules hook could rewrite the whole
ruleset, so one appended allow outranked every configured deny for
calls and listing. Agents and sessions showed nothing. The rule
objects were also the agent state's own, so an edit in place changed
the agent for every session.
The new shape is { sessionID, agent, rules, session, deny }.
- rules (agent then session) and session are fresh copies of each
rule. Core ignores them after the hooks run.
- Core reads only event.deny and decodes it with
Schema.Array(Struct({ action: String, resource: String })). Other
fields of an entry, such as effect, are dropped, so each entry is a
deny.
- Core returns [...agent, ...session, ...denies], in the order the
hooks pushed them. Nothing a hook writes can allow, remove or
reorder a rule.
Before this, a configured deny was final: evaluateInput returned deny
before any hook ran. That holds again. A hook can only add denies,
and they are checked in the same place.
A deny entry that is not two strings dies with 'A permission
"experimental.rules" hook added an invalid deny: ...'. The request
or step fails closed instead of running without the hook's denies.
L2: the TSDoc says that the hook runs for every permission check and
every step, must be quick, and must not request permissions itself.
A request would run the hook again without end. The evaluate hook
next to it has no re-entrancy guard, so this hook documents the
constraint in the same way.
Tests (permission.test.ts):
- A hook pushes an allow, edits rules in place, changes the arrays
and adds an entry with effect "allow". None of this reaches the
rules or the agent state, and configured denies and asks still
decide.
- Two hooks' denies are appended in order.
- A hook's deny refuses a request before any evaluate hook runs.
- A malformed entry fails closed and names the hook.
Before, a step listed tools, skills and MCP servers from
merge(agent, session) built in SessionContext.select, while calls were
evaluated from the same merge built separately in Permission. A plugin
that changed how calls were decided (the browser plugin's evaluate
hook) could not change what was listed, so the two disagreed.
Now Permission.rules(hooks, { session, agent }) is the only place that
builds the ruleset. Permission's evaluation (assert, ask,
assertNotDenied, allows), SessionContext.select (tool snapshot, Code
Mode catalog and search, skill and MCP instructions) and scheduled
code checks all use it.
Permission.rules triggers a new experimental plugin hook,
permission "experimental.rules". The hook gets the session ID, the
agent ID, the session's own rules (read-only), and the merged rules
(agent, then session). The hook can append rules, which are evaluated
last. Core does not restrict what a hook writes. Hooks are trusted in
the same way as permission.evaluate hooks, which can already set any
effect. With no hook registered, the result is the same as the old
merge.
Agent resolution changes from agents.resolve to agents.select. This
gives the same agent info, and the hook gets an agent ID even when the
default agent is used. An agent that cannot be resolved still gets
the deny-all rule.
The tool-hiding predicate (the last rule matching the action is a deny
on "*") moves to @opencode/schema/permission as deniesAll. Plugins can
then apply the same predicate as Tool.snapshot. Tool.snapshot and
Tool.check use it with the same matching as before (case-insensitive
on Windows).
A saved 'always' approval used to answer an ask raised by any permission.evaluate hook, for every tool, and dropped the hook's message. Core no longer overrides a hook's ask. Hooks get a read-only experimental.approved instead, true when saved approvals allow every resource; the browser hook uses it to stop asking for a configured browser ask the user already approved always.
the stats site, its og worker and the sync workflow deploy from services/data with cf as
opencode-data-<stage>, opencode-data-og-<stage> and opencode-data-sync-<stage>. the beta
web app and the whole sst setup (sst.config.ts, infra/, sst-env.d.ts, the sst dependency)
are gone, so nothing deploys through sst anymore (security finding #920).