Commit graph

22661 commits

Author SHA1 Message Date
Luke Parker
445f8c03ee docs(browser): stop telling agents to focus a tab before a screenshot 2026-11-13 08:40:29 +10:00
Luke Parker
a7a65bd01e Merge branch 'browser-deny' (fbd7c7ed93) into persisted-browser 2026-11-13 08:40:05 +10:00
Luke Parker
f55262760b Merge branch 'hidden-screenshot' (8dff083592) into persisted-browser 2026-11-13 08:39:47 +10:00
Luke Parker
91f4cf5dc6 Merge branch 'browser-tool-fixes' (01c3b90bd2) into persisted-browser 2026-11-13 08:39:19 +10:00
Luke Parker
fbd7c7ed93 fix(browser): honour per-operation browser denies and configured asks over the grant
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.
2026-11-13 08:38:56 +10:00
Luke Parker
fa2d19210e Merge branch 'browser-deny' (be740a5d01) into persisted-browser 2026-11-13 08:38:07 +10:00
Luke Parker
ea246716fc fix(desktop): re-sign unsigned macOS builds after flipping fuses 2026-11-13 08:37:55 +10:00
Luke Parker
27bb4c2071 Merge branch 'cookie-encryption' into persisted-browser 2026-11-13 08:37:46 +10:00
Luke Parker
01c3b90bd2 fix(browser): pause when wait gets only a timeout, and say what it waited for
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.
2026-11-13 08:37:37 +10:00
Luke Parker
3b43523a33 Merge remote-tracking branch 'origin/dev' into persisted-browser
# Conflicts:
#	packages/gui-plugins/src/browser/model.ts
2026-11-13 08:36:46 +10:00
Luke Parker
8dff083592 fix(browser): screenshot, click and hover tabs that are not on screen
A page whose view starts hidden, and the renderer a cross-site navigation starts in a hidden tab, never renders: the backgroundThrottling preference does not wake it. Re-apply it on every commit so hidden tabs keep rendering frames.

Viewport and element screenshots now copy the tab's last rendered frame (capturePage with stayHidden), which works while the tab is hidden, instead of refusing unless the Review pane shows it. They wait for a pending main-frame navigation and a fresh frame first, so a capture never shows the page a redirect left. Full-page captures still need the tab on screen and say so.

Click and hover no longer force a capturePage after scrolling, which threw UnknownVizError on hidden tabs; they wait for a rendered frame instead. The capture error no longer advises browser.tabs.focus, which did not help.
2026-11-13 08:32:49 +10:00
Luke Parker
598a7a6816 fix(codemode): record each inner tool call's error message
metadata.toolCalls kept only { tool, status, input }. When a program caught an inner call's failure, its message was lost: 30% of browser errors in the recorded sessions have no message, and analysis had to guess the cause from the input. Each failed row now carries error, bounded to 2,000 characters. Interrupted calls stay without one.
2026-11-13 08:32:08 +10:00
Luke Parker
4eba797900 test(browser): type the scripted desktop's outcomes as the RPC receives them 2026-11-13 08:32:07 +10:00
Luke Parker
7cb3ee8324 docs(browser): teach the browser tools as they now work
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.
2026-11-13 08:32:05 +10:00
Luke Parker
3b3761500a fix(browser): fail preview for a missing file and name the file when no desktop is connected
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).
2026-11-13 08:32:04 +10:00
Luke Parker
3912f39561 fix(browser): name the bad value and the next step in browser errors
- 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.
2026-11-13 08:32:02 +10:00
Luke Parker
ab070226b4 fix(desktop): line up extension verdicts and actions in columns 2026-11-13 08:26:54 +10:00
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
Luke Parker
5778f64f3d fix(browser): revoke the attach grant a subagent inherits from its parent
A child session copies its parent's permissions, so a subagent spawned from an
attached session got the browser:* and skill:browser allows but no attachment.
It listed the browser tools and the Browser skill, every call failed with
[browser.disconnected], and the copied allow outlived the parent's attachment.

The plugin now revokes the grant from a child session while the child's prompt
is admitted (session prompt hook), before any step of the child can list the
tools, so there is no race with its first step. It holds the attachment lock
while it checks and writes, and skips a child that has an attachment of its own.
A subagent whose agent denies the browser stays denied even when the desktop
attaches to it, through the check from the previous commit.

Refs #61238
2026-11-13 08:25:05 +10:00
Sara Kay
aed4cbc024
fix(gui-plugins): keep the pairing QR code dark on light in every theme (#63220)
Co-authored-by: ssskay <ssskay@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 17:24:52 -05:00
Luke Parker
2070e0a68a fix(browser): infer the wait condition and report a timeout as met: false
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.
2026-11-13 08:23:17 +10:00
Luke Parker
5a066a4635 fix(browser): accept expression and code for evaluate and run top-level return and await
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.
2026-11-13 08:19:05 +10:00
Luke Parker
d476f4c9d0 fix(browser): reject unknown tool parameters and name the valid ones
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: ...'.
2026-11-13 08:17:45 +10:00
Luke Parker
34490b7c7d fix(browser): let a configured browser deny win over the desktop's attach grant
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
2026-11-13 08:16:25 +10:00
Luke Parker
eba94cf831 feat(desktop): say whether a browser extension works here, from its manifest 2026-11-13 08:03:05 +10:00
Luke Parker
a7bb038c5a fix(desktop): encrypt browser cookies at rest 2026-11-13 07:54:52 +10:00
Adam
f179e6e5f0
fix(tui): drop tool-result image bytes from the transcript store unless image previews are on (#63577)
Some checks are pending
deploy / data-build (push) Waiting to run
bot-nix-hashes / hash (blacksmith-4vcpu-ubuntu-2404, x86_64-linux) (push) Waiting to run
bot-nix-hashes / hash (blacksmith-4vcpu-ubuntu-2404-arm, aarch64-linux) (push) Waiting to run
bot-nix-hashes / hash (blacksmith-6vcpu-macos-latest, aarch64-darwin) (push) Waiting to run
bot-nix-hashes / compute (push) Blocked by required conditions
bot-nix-hashes / publish (push) Blocked by required conditions
check-nix / nix-eval (push) Waiting to run
check / typecheck (push) Waiting to run
deploy-files / files-build (push) Waiting to run
deploy-files / files-deploy (push) Blocked by required conditions
deploy-site / site-build (push) Waiting to run
deploy-site / site-deploy (push) Blocked by required conditions
deploy / legacy-build (push) Waiting to run
deploy / legacy-deploy (push) Blocked by required conditions
deploy / data-deploy (push) Blocked by required conditions
Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
2026-11-12 15:17:44 -06:00
James Long
fd6a1167b4
fix(tui): give shell mode its own prompt color under new designs (#63605) 2026-11-12 16:09:20 -05:00
David Hill
9bc30594ab
refactor(site): put every neutral grey on one shared scale (#63604)
Some checks are pending
deploy-files / files-build (push) Waiting to run
deploy-files / files-deploy (push) Blocked by required conditions
deploy-site / site-build (push) Waiting to run
deploy-site / site-deploy (push) Blocked by required conditions
deploy-update / update-build (push) Waiting to run
deploy-update / update-deploy (push) Blocked by required conditions
deploy / legacy-build (push) Waiting to run
deploy / legacy-deploy (push) Blocked by required conditions
deploy / data-build (push) Waiting to run
deploy / data-deploy (push) Blocked by required conditions
2026-11-12 20:57:16 +00:00
Aiden Cline
a3d6e54b3d
fix(codemode): decode UTF-8 across chunk boundaries (#63600) 2026-11-12 20:30:06 +00:00
Aiden Cline
8921769577
fix(core): drop stale thinking when Claude Agent prompts or tools change (#63592) 2026-11-12 13:56:50 -06:00
Adam
ebf6e00ad3
docs(console): document Send identity on custom providers (#63596) 2026-11-12 13:49:08 -06:00
James Long
a1aa513f78
fix(core): resume directly driven child sessions after restart (#63415) 2026-11-12 14:23:00 -05:00
opencode-agent[bot]
8c809fb1f8
docs(console): add Gemini 4 Hydrogen to Zen (#63589)
Co-authored-by: opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com>
2026-11-12 11:10:55 -08:00
James Long
6cca598863
fix(session-ui): keep links whose label contains inline code (#63587) 2026-11-12 13:51:17 -05:00
James Long
becb9c7c9f
fix(app): order Recent sessions by the last list reload and drop the rename guard (#63370) 2026-11-12 13:45:04 -05:00
usrnk1
f738b32d23
feat(app): jump to an earlier prompt by searching session messages (#63585) 2026-11-12 19:41:08 +01:00
James Long
a73657f3f9
refactor(codemode): flatten the VM into src and remove two-engine leftovers (#63377) 2026-11-12 13:39:15 -05:00
James Long
3cfe63a182
fix(tui): restore pasted text when undo brings back its placeholder (#63265) 2026-11-12 13:34:17 -05:00
James Long
89e66ae70e
fix(tui): restore the live draft after browsing prompt history (#63262) 2026-11-12 13:33:17 -05:00
Aarav Sareen
0996030161
feat(app): show a free limit panel in place of the composer (#63531) 2026-11-13 00:01:25 +05:30
Luke Parker
5418e010d7
chore(perf): bench with strobe 0.32.0 (#63575) 2026-11-12 16:58:55 +00:00
James Long
28f74f8591
fix(tui): copy the paste inside the prompt selection (#63275) 2026-11-12 16:50:11 +00:00
James Long
32a00c976d
fix(tui): keep the Mini draft caret when closing the command palette (#63260) 2026-11-12 16:49:22 +00:00
Dax
71b27c4cd8
fix(app): reuse mention suggestions while typing (#63572) 2026-11-12 11:46:46 -05:00
Aiden Cline
f96b54590d
docs: describe tools exposed directly when execute is denied (#63566) 2026-11-12 10:28:25 -06:00
David Hill
33aefad13c
chore(site): serve OG Studio link cards from the files bucket, add docs previews (#63560)
Co-authored-by: Adam <2363879+adamdotdevin@users.noreply.github.com>
2026-11-12 10:00:20 -06:00
David Hill
1a85993784
chore(site): render Ukrainian and Russian link cards in OpenTUI Mono's Cyrillic (#63556) 2026-11-12 09:30:37 -06:00
Filip
ec263d62b6
fix(core): keep plugin swaps going when a cleanup fails (#63548)
Co-authored-by: Filip Hejmowski <fhejmowski@simplito.com>
2026-11-12 16:15:41 +01:00
usrnk1
96d950178c
fix(app): advance SSH prompts and close the dialog on connection (#63544) 2026-11-12 15:14:43 +00:00