Repository navigation
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
There was a problem hiding this comment.
Looks sound overall. The local-server path (sameMachine uses the persistent partition directly, with per-page file: grants by webContentsId) and the link routing (plain clicks inside [data-pane-row]; the file handler now skips http(s)) fit the existing host/plugin boundary. I could not run it: it all runs in the Electron desktop app, which isn't available here. bun test src/browser passes (205) and tsc --noEmit is clean for gui-plugins and app. The packages' typecheck script fails here with Script not found "check", so I ran tsc directly.
Public API: the plugin SDK, server HTTP API, config and CLI are unchanged. Additions are internal to the built-in browser plugin: a preferences store (links, default on), a BrowserProfile Ipc, a persist:opencode-browser partition and a browser-extensions folder under the app's user data.
Main concern: mirroring the whole profile's cookies into remote servers' partitions (inline comment). Before/after screenshots or a short video of the Settings › Browser page would help, since I could not render it.
Fixes #60313
Fixes #53580
Fixes #55730
Related: #52419, #62989
|
|
||
| if (!shared) { | ||
| handle.network = yield* createBrowserNetwork({ rpc, attachment, location: options.location, partition }) | ||
| // Sign-ins carry over both ways, so a page of a remote server is signed in where the profile is. |
There was a problem hiding this comment.
This copies every cookie in the profile into each remote server's partition, including sign-ins imported from the user's personal Chrome, Safari or Firefox, and syncs changes both ways. Pages there load through that server's tunnel, and the agent on it can drive and browser.evaluate those pages. So any remote server the user attaches to gets the user's full set of personal sign-ins, not just the ones made for the work. Cookies for plain http: sites also cross the tunnel unencrypted. Local servers already had this level of access, but a remote one may belong to someone else. Could remote partitions stay unlinked by default, or ask once per server before mirroring?
There was a problem hiding this comment.
The new commits look sound. I could not run them: they change only the desktop pane and settings, and the desktop app can't run here. bun test src/browser passes (206) and tsc --noEmit is clean for gui-plugins.
Public API is still unchanged. The internal additions are a welcomed field in the browser plugin's preferences store and an optional icon on the BrowserProfile Ipc's sources.
The earlier point about mirroring all profile cookies into remote servers' partitions is not addressed yet; that thread stays open. Nothing new to raise.
|
In addition to having a default, shared browser profile, it would be good for the user to be able to specify the profile in order to work concurrently on things that may compete for browser state. |
|
hmm cool idea @esafak.. I'll explore that |
There was a problem hiding this comment.
The new commits look sound. I could not run them: they change only the desktop app's browser plugin, and the desktop app can't run here. bun test src/browser passes (214) and tsc --noEmit is clean for gui-plugins.
Public API is still unchanged. The internal additions are a compatibility verdict on extensions in the BrowserProfile Ipc, a force flag on its install request, and an unsupported install result.
The earlier point about mirroring all profile cookies into remote servers' partitions is not addressed yet; that thread stays open. Nothing new to raise.
There was a problem hiding this comment.
I could not run the new commits: the desktop app can't run here. In plugin-browser, the new preview-path test fails on Linux (inline). In gui-plugins, bun test src/browser passes (217), and the core browser permission and tool tests pass (35).
The earlier point about mirroring all profile cookies into remote servers' partitions is not addressed yet; that thread stays open.
The pull request now also carries separate work: browser permission handling (configured denies and asks over the attach grant, per-operation rules, revoking a subagent's inherited grant), browser tool input and preview changes, a code mode metadata change, and an Electron fuse that encrypts all of the app's cookies. These stand on their own; separate pull requests would be easier to review and revert.
Public API (all additive, but behaviour changes):
- Code mode
executemetadata:toolCalls[]gains an optionalerror. - Browser tools now call the permission check with action
browserand the operation as resource. Configuredbrowserdenies, asks and per-operation rules now apply, andpermission.evaluatehooks see browser calls. - Browser tools reject unknown parameters.
browser.evaluateacceptsexpression/code.browser.waitinfers its condition.
Callers that relied on the grant overriding a configured deny, or that pass extra tool parameters, will see refusals.
packages/plugin-browser/src/files.ts:68: On Linux and macOS,site\index.htmldoesn'tstat(a backslash is a valid filename character there). The suffix search then finds the file, because it normalizes\to/, butabsolutekeeps the raw backslash. The new test fails here: it expects<dir>/site/index.htmland gets<dir>/site\index.html. Without a desktop connected, that wrong path is the one preview reports to the user. Normalizing\to/inplainbefore resolving it (and before the suffix search) would fix both.
There was a problem hiding this comment.
The new commits look sound. I could not run them: they need the desktop app attached to a session. The core browser permission, browser tools and permission tests pass (149). plugin-browser still has the one failing preview-path test on Linux: site\\index.html resolves with the backslash kept, in BrowserFiles.locate (files.ts), which these commits don't touch.
The earlier point about mirroring all profile cookies into remote servers' partitions is not addressed yet; that thread stays open.
Public API, new in these commits: core's permission check now treats a saved "always" approval as answering an ask that a permission.evaluate hook raised. This applies to every action, not just browser. Before, a hook's ask always prompted. The built-in managed policy hook only denies, so it isn't affected. A third-party hook that asks on purpose would now be skipped when the user has saved an approval matching every resource. If that's intended, it's worth a line in the plugin docs.
There was a problem hiding this comment.
I could not run the new commits: they all run in the desktop app, which can't run here. bun test src/browser passes (261) and tsc --noEmit is clean for gui-plugins. plugin-browser still has the one preview-path failure on Linux (site\\index.html keeps its backslash in files.ts).
The earlier point about mirroring all profile cookies into remote servers' partitions is not addressed yet; that thread stays open.
New: these commits add about 2,500 lines that rebuild parts of Chrome's extension APIs in the desktop app's main process: chrome.tabs, windows, cookies, contextMenus, webNavigation, notifications, storage.sync, permissions and action/popups, plus a preload script in every frame of the profile. Caller identity comes from the frame's address or the worker's scope, and chrome.cookies checks host permissions, so I found no blocker. Still, this is a large, security-sensitive surface that stands on its own, apart from the profile, link routing and import. With the pull request now at 85 files, a separate pull request for it would be much easier to review and revert.
Public API: unchanged by these commits.
There was a problem hiding this comment.
The new commits look sound. I could not run them: they change only desktop browser behaviour, and the desktop app can't run here. bun test src/browser passes (264) and tsc --noEmit is clean for gui-plugins. plugin-browser still has the one preview-path failure on Linux (site\\index.html keeps its backslash in files.ts).
The earlier point about mirroring all profile cookies into remote servers' partitions is not addressed yet; that thread stays open.
Public API: unchanged by these commits. Nothing new to raise.
There was a problem hiding this comment.
The new commits look sound. The preview-path failure on Linux is fixed: plugin-browser tests now all pass (121), and tsc --noEmit is clean for plugin-browser and gui-plugins. The compatibility-table change is a refactor with no change in behaviour.
The earlier point about mirroring all profile cookies into remote servers' partitions is not addressed yet; that thread stays open.
Public API: unchanged by these commits. Nothing new to raise.
There was a problem hiding this comment.
The new commits address my earlier point: remote servers' partitions now mirror the profile's cookies only after the user turns on sharing in Settings › Browser (off by default), and turning it off removes the shared cookies. The core change that let a saved approval override a hook's ask is gone too. I could not run the desktop app here. The gui-plugins (1,280), plugin-browser (121), core permission (145), app loopback (8) and desktop builder config (14) tests pass, and tsc --noEmit is clean for gui-plugins.
Public API, all additive:
permission.evaluatehook event: new optional, read-onlyexperimental.approved(effect and promise plugin types).@opencode/schema: newWildcard.matchexport.@opencode/app: newloopbackexport.- From earlier commits: browser tools follow configured
browserpermission rules and reject unknown parameters; code modetoolCalls[]gains an optionalerror.
Nothing new to raise.
There was a problem hiding this comment.
The new commits look sound. I could not run them: they need the desktop app, which can't run here. In gui-plugins, bun test src/browser passes (342) and tsc --noEmit is clean. Sharing sign-ins with remote servers is still off by default, so the earlier cookie-mirroring point stays addressed.
Public API: unchanged by these commits. Nothing new to raise.
There was a problem hiding this comment.
The new commit looks sound. I could not run it: it needs the desktop app, which can't run here. In gui-plugins, bun test src/browser passes (343) and tsc --noEmit is clean. The new test is small and clear. Sharing sign-ins with remote servers is still off by default, so the earlier cookie-mirroring point stays addressed.
Public API: unchanged by this commit. Nothing new to raise.
There was a problem hiding this comment.
The new commits look sound. I could not run them: they need the desktop app, which can't run here. In gui-plugins, bun test src/browser passes (346) and tsc --noEmit is clean; desktop builds clean with tsc -b.
Previews now load through oc-preview:// with a random host per attachment. Each file is served only to that preview's own pages, after the workspace-root and symlink checks. Raw file: requests are refused in the profile and in remote partitions. One effect worth knowing: a previewed page's absolute file:// subresources no longer load (relative ones do).
Sharing sign-ins with remote servers is still off by default, so the earlier cookie-mirroring point stays addressed.
Public API: unchanged by these commits; @opencode/gui-plugins/schemes is a new internal export the desktop app uses. Nothing new to raise.
There was a problem hiding this comment.
The new commits look sound. I could not run them: they need the desktop app, which can't run here. In gui-plugins, bun test src/browser passes (333) and tsc --noEmit is clean. plugin-browser passes (121), and desktop builds clean with tsc -b.
Native file: access is now refused for the whole browser session instead of being toggled, so extension request blocking no longer turns off while a file: page is open. Previews re-check the path and the grant on every request and clear a revoked origin's storage.
Sharing sign-ins with remote servers is still off by default, so the earlier cookie-mirroring point stays addressed.
Public API: unchanged by these commits. Nothing new to raise.
There was a problem hiding this comment.
The new commits look sound. I could not run them: they need the desktop app, which can't run here. In gui-plugins, bun test src/browser passes (337); plugin-browser passes (121), including the new symlink-escape case. tsc --noEmit is clean for both.
One behaviour change worth knowing: browser.preview now refuses files outside the session's real workspace, including through a symlink, where it used to leave that to the pane. This matches what the oc-preview: handler can serve.
Sharing sign-ins with remote servers is still off by default, so the earlier cookie-mirroring point stays addressed.
Public API: unchanged by these commits; @opencode/plugin-browser/workspace is a new internal export. Nothing new to raise.
There was a problem hiding this comment.
The new commit only updates an MCP test to expect the toolCalls[].error message Code Mode now records; it passes. Sharing sign-ins with remote servers is still off by default, so the earlier cookie-mirroring point stays addressed.
Public API: unchanged by this commit. Nothing new to raise.
…code into persisted-browser
…rows The button was a direct child of the popover, so it stretched edge to edge and stuck out 8 px past every other row. It now sits in a row with the same inset and icon column as its neighbours and starts under their text.
…anslations refused.external and external.menu have no reader left. external.open still said 'system browser' in 62 locales after English changed to 'default browser'; those entries are dropped so they fall back to English.
…tore with the tab as it is On a restored tab whose load the startup gate still held, the agent's back and forward ended the wait, kept the saved address, and then failed with 'The tab is no longer at the approved site', because the renderer shows its inert blank document. Nothing changed site: a load that was never issued committed nothing and has no history. Back, Forward and Stop there now return the unchanged tab with its kept address and no history, and Reload is judged by the address it loads.
…resh frame A full-page capture of a never-shown background tab took 5.6 s of its 6 s deadline on macOS (0.7 to 1.0 s on Windows for about 15.6 MP): the wake-up and first paint of the tab come out of the same budget. The deadline is now 15 s, well inside the tool's 60 s.
…code into persisted-browser
…page is gone On macOS, uBlock Origin's element picker crashed the main process (EXC_BAD_ACCESS at 0xe0 in views::NativeViewHostMac::GetNSWindowHost, from ~InspectableWebContentsView). The popup's page calls window.close() as the picker starts, which blurs the popup first; the blur handler then took the view out of the window and closed the contents while the page's own close was in flight, so Electron 44 destroyed the contents with its web view outside any window and dereferenced the missing widget. The popup is now hidden at once and stays a child of the window until its destroyed event, then is removed a tick later. A minimal Electron 44.9.1 reproduction on macOS crashes with the same frames in the old order and survives in the new one.
…d startup gate Runs one pane page with a workspace in the pinned Electron and submits addresses as the address bar does: a file inside the workspace opens as a scoped preview and shows its own address, one outside is refused with the previous page in place, a web address loads, and a web address typed while the startup gate holds, then Stop, requests nothing and leaves the committed page in the bar. The fixture runner can now grant the product's privileged schemes before the app is ready.
…n plain words A page that did not load is explained where the page would be, with a plain title, one sentence, Reload and Chromium's code small under it. The strip under the address bar is gone: a command that failed says what was tried, with Try again, and a load the tab reports itself (failed, stopped, became a download, or still under way at the command's deadline) is no longer a failed command. No failure reaches the person as the generic Request failed. Reworded the plugin's copy for a general audience; changed keys fall back to English in the other locales.
…ns behind a disclosure Load unpacked is now Add from a folder inside a closed For developers disclosure at the end of the Add an extension dialog, and the cookie-file import sits behind the same disclosure in the import section.
…her, and keep row icons sharp An extension that declares its icon only as action, browser_action or page_action default_icon no longer gets the fallback glyph. Of icons given by size, the smallest that covers the drawn size on a 2x display is used, so Dark Reader's 48 px icon replaces its 16 px one. Windows reads a browser's 64 px program icon, and finds a browser installed outside the usual folders through its App Paths entry.
…ane's menu and site information Settings > Browser opens on Import sign-ins, Extensions and the links switch; the rest sits in one closed Advanced section, a ghost heading that is a button, remembered on this device and opened by a settings search hit. Each browser row has one Import... button whose dialog brings everything or reveals the site list in place. The extension review is one verdict line, one sentence and Details. The pane's bar keeps back, forward, reload, the address and Extensions; Add page to session, the comment tool, Open in default browser, the reload without saved files and Clear history move into the options menu and its More tools submenu, with zoom as one row. Site information opens on the site and its connection, with Site settings one step away. The import dialog's top row is no longer clipped by the dialog's scrolling body.
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.
…outline Menu.ItemRow is a row that is not an action itself: its name is set as an item's label and its small items sit where a shortcut or chevron does, so neither can drift from the rows around it. Up and Down walk its items in order; Left and Right move between them. Button gains flush (start or end) for a button without an outline at an edge of its container: the label lies on the edge and the hover box hangs outside by the button's own inset.
…ettings Measured over CDP at 100% and 125%. The zoom row is a Menu.ItemRow, so its name starts where the other labels do and its plus ends where the shortcut keys and the chevron do. Back, forward and reload stand 4 px apart like the buttons at the other end of the bar. In the import dialog, Choose sites and Select none lie on the dialog's edges and a site's count shares its name's baseline. In Add an extension, For developers reads like the other disclosures, and the list's scroll thumb lies in the dialog's inset so rows keep their right edge when the list scrolls. In Site settings, the back glyph is in the icon column, the heading in the text column, and the site's name on the heading's baseline.
Choose sites mounts the list after its sites loaded, and nothing told the virtualizer about the new viewport, so it never saw the list scroll: past the first rows the list was blank. The viewport is now a signal the virtualizer follows, set once the element is in the page, because an element still outside it has no window to observe with.
marked-parser.tsx: dev's latex and math fences render in our code renderer, with the same KaTeX limits, and leave the parser through the display-math slot like a \$\$ formula; a fence KaTeX cannot parse stays highlighted code. The containment spec gains an oversized formula in a math fence.
…rop getter The embed's visible prop was a condition written inline, which compiles to a getter that makes a new computation on every read. The host reads the prop from callbacks with no owner, so each read left one behind: the window logged "computations created outside a createRoot" several times a second while the pane was open. The condition is now one memo under the pane's owner.
…the pane showed before A person who opened the side panel and closed it again during a run, before the agent showed anything, was taken to have dismissed the agent's pages: the first preview then opened nothing. Closing the pane is a dismissal only once the pane has shown the agent's page in that run. A preview now selects its tab in a pane that is open on another tab, behind the same click guard, and so does a file preview. For a session that is off screen or in a hidden window the tab is selected in its strip and marked, so it shows when the person returns. A request that arrives before the strip can be written or before the inventory that carries its tab is kept and applied when they land. A focused tabs.open, tabs.focus and navigate behave as before.
The chevron follows the summary while the section is closed and the heading while it is open, 4 px after the text like the other disclosures. A summary too long for the window is cut short, so the chevron never wraps or leaves its word.
The popup's top was its button's bottom plus a fixed 4 px, which is inside the toolbar: 4 px above the page at 100% and 7 px at 125%. The window now reports the page area's top with the click and the popup starts there, below a find or notice bar too. Each edge is rounded by itself, as the page view's edges are, so the popup lands on the same pixels as the page and the button.
What you can do now
browsertoaskand every call prompts with the site, the script or the files it wants.persist:opencode-browserprofilefile:or a sandboxed iframeoc-preview:page, folder-scoped, local and remotebrowser-loop.mp4
22 seconds, real footage of this branch on made-up sites: signed in from a chat link, sign-ins imported in one click, the agent answering about a signed-in page, asking before it acts, a report it built opening in the pane, a checkout tested in a background tab, an ad blocker and Dark Reader at work, and everything still there after a restart.
Screenshots
Each composite shows the earlier build on the left and this PR on the right.
Settings and import
Sign-ins and extensions first; the rest under Advanced
Advanced opened: sharing, permissions, site data
Import dialog fields keep their whole outline
Import all, or choose the sites
Clear saved files and stay signed in
Pages and the pane's menu
A failed page says what happened, with Reload
Everyday actions first; extensions get a puzzle piece
Site information: status first, details one step away
Less common tools under More tools
The menu and More tools, dark
Extensions
One plain verdict before adding an extension
Add from a store link or your browsers
Details show the rest, when you want it
Developers add an extension from a folder
An extension's own popup: Dark Reader
Agent activity
The agent's tabs carry an activity dot
Activity dots, dark
Why
Measured tool-call errors
Browser calls from the session databases of four devices (two Windows, one macOS, one Linux with a remote desktop): 14,974 calls, 3,099 errors.
waitwithoutconditionscreenshot"needs a visible tab"evaluatewithoutscriptexpression,codeaccepted[browser.disconnected]return,awaitruntoolCalls[].errorpreviewclickUnknownVizErrortab_unavailablewaitnot metmet: falseCommunity issues
obsidian://) for chat links #56263.Architecture
flowchart LR link["chat, file tree or agent preview"] --> tab["pane tab"] tab --> kind{"what is it?"} kind -->|"web page"| profile["persist:opencode-browser"] kind -->|"workspace HTML or artifact"| handler["oc-preview: handler<br/>profile/previews.ts, serve.ts"] handler -->|"local"| handle["open file, check kernel path<br/>util/contained-file.ts"] handler -->|"remote"| read["server experimental.preview.read"] handler -->|"artifact"| art["artifact view, one grant"] profile --> guard["session-guard.ts<br/>file: refused, downloads, client certs"] profile --> prompts["page-prompts.ts<br/>dialogs, permissions, sign-in"] profile --> ext["extensions + extension-api"] remote["remote server partition"] <-.->|"cookies, only if shared"| profile agent["agent browser.* call"] --> order["deny, input, authorize,<br/>attached, read rules"] order --> gate["desktop: extension refusal,<br/>hit and focus check, picker guard"] gate --> tabProfile and import
One persistent profile for the whole app; remote servers stay signed out unless you share.
profile/index.ts,sources.ts,chromium.ts,firefox.ts,safari.ts,cookie.ts,probe.ts,link.ts,link-machine.ts,import-prompt.tsx,settings.tsx(all underpackages/gui-plugins/src/browser/).v20app-bound cookies get their own line.powershell.exeunder%SystemRoot%,/usr/bin/security,secret-toolfrom/usr/binor/bin. No shell, 60 s kill.profile/sites.ts,site-chooser.tsx): the list groups cookies by registrable domain and lists hosts and dates only; selection matches hosts exactly. Keyboard and screen readers work.settings.tsx): sign-ins, extensions and the links switch come first. Remote sharing, the agent-pages switch, site permissions, site data and the cookie-file import sit under one closed "Advanced" heading; a settings search that hits inside opens it.webauthn-gate.ts,passkey-groups.ts): requests fail fast on macOS and Linux, and in agent-driven tabs everywhere.Links
Plain clicks on web links open in the pane; everything else keeps its old target.
createWebLinksinpackages/app/src/runtime/plugin/render.tsxandweb-href.tstake absolutehttp(s)://links only.packages/gui-plugins/src/terminal/terminal-key-event.ts. Ctrl/Cmd+click opens web links in the pane; Shift sends a link to the system.file:links never reach the OS.packages/app/src/runtime/plugin/app-links.ts): a real click shows the pane's confirmation with the full target.obsidianopensopenandsearchonly;mailtoonly without attachments.packages/session-ui/src/components/markdown-cache.tsx): model- and tool-written HTML passes tag and attribute allowlists. No positioning, pop-over, command or dialog.Local and remote previews and artifacts
Every workspace HTML page and artifact loads through one handler on a random per-grant origin.
profile/previews.ts,profile/serve.ts,preview.ts,workspace-file.ts,remote-preview.ts,remote-address.ts,artifact-preview.ts,artifact-link.ts,packages/util/src/preview-scope.ts,packages/util/src/contained-file.ts,packages/server/src/handlers/preview.ts.browser.previewopens in the pane. The sandboxed iframe stays only in the web app. The pane menu has "View source".file:: a worker made by afile:page reads any local file pastwebRequest. That gap exists ondevtoo.file:///URLspushStateto real filesid_rsaand friends,credentials,secrets.*,.pem,.key,.pfx,.p12.GET /api/experimental/preview/read, session-scoped, same rules on the server. Older servers fail closed with "Update this session's server".file:, remote pagesworkspace://<session>/<path>, artifactsartifact://<id>/<path>. Only real workspace files become a shown address.readandexternal_directoryrules. Ask and deny return no bytes.document_changed.Connection-Allowlist: (response-origin);webrtc=block, no popups, forms or navigation away. A clicked link asks before it opens.file:: refused in every web contents of the profile and remote partitions (session-guard.ts).503 file_verification_unavailable, and the pane and agent show a distinct message. A missing file stays404.packages/util/src/handle-path.ts,file-verification.ts):packages/cli/script/build.ts).afterPackhook requires the target's binding unpacked from the asar, of the right architecture, or the build fails (packages/desktop/script/preview-binding.ts).flowchart LR req["oc-preview://grant/path"] --> g{"live grant, GET or HEAD, own initiator?"} g -->|no| err["Response.error"] g -->|yes| s{"inside pinned folder, no dot or secret name?"} s -->|no| err s -->|yes| r{"agent tab: read rules allow?"} r -->|no| err r -->|yes| h{"opened handle's kernel path still inside?"} h -->|no| err h -->|yes| ok["stream from the handle, Range, nosniff, no-store"]Browser chrome
The pane now behaves like a browser around the page.
page-menu.ts,native-page-menu.ts. Navigation, link, image, edit and spelling items, plus extension items for pages they may see.page-find.ts,find-machine.ts,find-bar.tsx. Ctrl/Cmd+F, Enter and Shift+Enter, Cmd+G or Ctrl+G and F3. The query stays with the tab.refusal-notice.ts,notice-actions.ts. One notice per tab with the real target.mailto,slack,vscode,zoommtg…); Copy link otherwise.window.openwithout user activation is blocked with "Pop-up blocked" and an Open action.host-display.tselides long hosts from the left, keeping the registrable domain. IDN shows as punycode.activation-delay.ts. Buttons on bars and dialogs ignore presses for 500 ms after they appear.panel.tsx,bar.css): back, forward, reload, the address with site information inside it, Extensions (a puzzle piece, for browser extensions only) and "⋯".i18n/en.ts).default-browser.ts): a manual item for the current page or a local HTML preview, launched through thehttpshandler. Only the person's click triggers it; previews and links still open in the pane.previewortabs.openwithfocus: true, and never takes focus.packages/app/src/runtime/plugin/embeds.tsx,embed-geometry.ts): the page view follows its placeholder and hides under floating app UI. Zero measure calls while the chat scrolls or streams.Dialogs, permissions and sign-in
Pages ask in the app, not in native boxes, and a decision is kept per site and partition.
page-prompts.ts,prompt-machine.ts,prompts.tsx,site-permissions.ts,site-auth.ts,media-gate.ts,system-media.ts.takeDialogsreplaces Electron's internal-run-dialoglistener and answers over CDP.media-gate.tsholdsgetUserMediauntil you answer, so macOS asks after the bar. The bundle declares camera and microphone usage.sign_in_requiredand never sees the credentials.Extensions
Store packages are verified, reviewed and pinned before they run.
profile/extensions.ts,install.ts,review.ts,integrity.ts,compatibility.ts,filter-startup.ts,profile/extension-api/.action.openPopuprefused.tabs,windows,action,webNavigation,contextMenus,cookies,notifications,storage.sync(quotas) are real. Others are stubs or Electron's own.urlortitlefilter. Unfiltered,activeand window queries still return it redacted. A private tab without aurlin aurlquery made uBlock Origin throw during startup and then pass every request.action.onClickedshows tab details only withactiveTabor existing access, and skips private tabs. Frames inside private tabs are not reported towebNavigation; no emptytabs.onUpdated.http(s)navigations wait for request-filtering extensions to start.extension-api/styles.ts):tabs.insertCSSandremoveCSSfor MV2 extensions, so uBlock Origin's cosmetic filtering works and its TypeError on every page is gone.activeTab: scoped to the tab of the pane that was clicked.extension-api/popup.ts): a popup that closes itself (uBlock Origin's element picker) stays in the window until its page is gone. This fixes a macOS main-process crash: in the app the picker opens, Escape quits it, and the app stays alive.Agent browser tools
The tools accept what models write, answer fast, and say what to do next.
packages/plugin-browser/src/{rpc,tools,files,machine,skill,preview-path}.ts,packages/core/src/codemode/tool.ts,gui-plugins/src/browser/{chromium,capture,child-targets,file-choosers,snapshot,field-value,agent-rendering}.ts.wait {tabID, text, timeout}condition: Missing keywait {tabID, timeout}waitthat times outmet: false,observedevaluate {tabID, expression}script: Missing keyawait xreturns its valuesnapshot {tabID}snapshot {tabID, interactive, maxLines}find {tabID, query}text: Missing keyqueryis an alias oftext)network.get {id, includeResponseBody}reload {tabID, ignoreCache}tabs.list {}without a desktopconnected: falsewith guidancepreviewof HTML{ path }{ path, tabID, url }, also off screenpreviewof a missing pathpreviewof a path outside the workspacesnapshot.ts): refs at any depth withinmaxChars(default 20,000) andmaxLines;interactive: truelists controls only.field-value.ts): Snapshots now print the current value of each filled form field, such as a search box, an email field, a text area or a rich-text editor (up to 160 characters), which 9e20e99 never printed; a field that is a password (also after a "show password" toggle makes ittype="text"), a file input, masked with-webkit-text-security, hasautocompletecurrent-password,new-password,one-time-codeor anycc-*, or whose accessible name, id, name, placeholder,aria-labelor label says password, passcode, PIN, OTP, CVV, CVC, card number, secret, token or SSN printsvalue=<hidden>instead, and an empty field prints no value.d44e103611)findreaches 1,277 of 1,278 docs controls and 577 of 579 article controls after.tabs.listthrows[browser.not_attached].agent-rendering.ts): throttling is off in tabs the agent used and in agent-driven pop-ups from creation. Such a tab is throttled again after 30 s idle and woken before the next command. macOS fails fast when minimized or hidden.Page.captureScreenshot.ce772bc1acce772bc1acce772bc1ac, a commit of this branch that already captured hidden tabs; ondevthe same screenshot is refused with "needs a visible tab".condition_unmet,document_changed,stale_ref,preview_unavailable,sign_in_required.[browser.invalid_result]instead of a 60 s timeout.Agent limits and permissions
The agent acts only where your rules allow, and never as you at the OS level.
permission.evaluatehook applies per-operation deny and ask with core's matcher (Wildcard.match,packages/schema/src/wildcard.ts). Missing or disabled agents are denied.Permission.rules,packages/core/src/permission.ts).experimental.ruleshook.Tool.snapshot, median of 20 stepsexperimental.approvedandapprovedSaveon the event (packages/plugin/src/{effect,promise}/permission.ts).evaluategets no manufactured user gesture.files.upload.Cookie encryption and fuses
Packaged builds encrypt cookies and close the plain-Node and debugger paths to the key.
packages/desktop/electron-builder.config.ts)EnableCookieEncryptionRunAsNodeEnableNodeCliInspectArgumentsEnableNodeOptionsEnvironmentVariablesrc/main/diagnostics/options.ts)NODE_OPTIONSstays: packaged apps ignore all but two options, and off would stripNODE_EXTRA_CA_CERTSfrom the CLI.app.asar; decrypt cookies as the same Windows user (DPAPI); start Beta with--inspect.Verification
b8d2153b27; the extension and screenshot fixes live on their own commits.5dea41d59bfor the main pass,ce772bc1acfor packaging (static), and a final pass at9e20e99a4f:573e5f155a: Stop during the startup wait, page-prompt shortcuts, the hard-reload chord and menu, a full-page capture of a background tab (5.6 s), a dialog after idle and uBlock Origin without console errors all pass. Native-menu shortcuts with real key presses were not driven.5361344011: a typedfile://address of a workspace file opens as a preview, with and without uBlock Origin; outside the workspace the refusal notice shows and the page is kept. uBlock Origin's element picker opens on the page, Escape quits it, and the app stays alive.53eebb7b55.dda8584328, measured in the running app withgetBoundingClientRect(), also at 125% scale): twelve offsets fixed across the menu, toolbar, import and extension dialogs and site settings. The 4 px switch inset in Settings is the host's rule for every page and stays.dda8584328, 763 browser tests and 101 component specs pass.packages/gui-plugins/src/browser/electron-run.ts) that cannot show a native dialog and survives the Linux first-use install race.e2ce09f782(run 44040193529, 15 of 15 jobs on the first attempt), and all 7 PR checks pass. That head includes the latestdev, merged with one conflict inpackages/ui/src/context/marked-parser.tsx: dev's new latex and math code fences now render through this PR's size limits and slot path, and a containment case for an oversized formula in a math fence was added and passes. Full tier was also green on5361344011(run 44006197713, 15 of 15 jobs on the first attempt, all 7 PR checks passing) and on53eebb7b55(run 43998022742, 15 of 15, first attempt).packages/patchmark/test/slow-inputs.test.ts(a 250 ms wall-clock bound),packages/app/e2e/regression/command-palette.spec.ts:14(a request-queue warning; the session page sends the same 47 requests ondevand here, 10 runs each) andpackages/app/e2e/regression/review.spec.ts:1159(also flaky ondev's run of the merged commit). The core test group "ShellTool stopped" (packages/core/test/tool-shell.test.ts), which this PR does not touch, failed once on Windows in two earlier full-tier runs of this branch and passed on re-run both times.Not verified:
Known limits
sender.tab. For a local preview this includes the file's path.sender.tabnatively; Chrome does the same for a frame inside afile:page.target="_blank", in-page links and redirects do not wait for request-filtering extensions in the first seconds after startup, install or enable. Replaying them could change opener, POST, referrer or history semantics.tool.usepolicy deny still lists the browser tools; calls are refused.findandsnapshoton a page of about 100,000 nodes stall the app's main process for about 2 s, the same as before this PR./varspelling on macOS: afile:///var/…address of a workspace file is refused as outside, because/varlinks to/private/var. The/private/var/…spelling works.dev). Back after Stop on a held restore can lead to a blank page.Notes for review
evaluatehas no user gesture; clipboard chords are refused.waitreturnsmet: false; unknown parameters are rejected; tool schemas change.askprompts, with site and script.previewortabs.openwithfocus: true; a setting turns it off.packages/app/component-tests/session-containment.spec.tsfails 10 of 14 cases on the previous filter, which is byte-identical ondev, and passes 14 of 14 here.GET /api/experimental/preview/read(client.experimental.preview.read;503 file_verification_unavailablewhen handles cannot be verified),experimental.approvedandapprovedSaveonpermission.evaluate, and a deny-onlypermissionexperimental.ruleshook.Browser.experimental.openreturns a branded handle, andexperimental.closecloses only that plugin's tab. It rejects when the session is not on screen. StableBrowser.openis unchanged.ctx.system.openExternallaunches onlyhttp(s)andmailto:URLs;file:URLs and plain paths now do nothing. Usectx.desktop.launch(path)to open a file.-run-dialoglistener.electron-dialogs.test.tsfails if Electron changes it.How to review by area (447 files, +36,578 / −3,113 against
dev):profile/index.ts,link.ts,profile/sites.ts,webauthn-gate.tspersisted-browseritself,browser-site-importprofile/serve.ts,util/src/preview-scope.tsbrowser-html-preview,browser-sec-previewpage-prompts.ts,page-menu.ts,default-browser.tsbrowser-prompts,browser-prompt-keys,browser-pane-open; menu and find onpersisted-browserapp/src/runtime/plugin/app-links.ts,markdown-cache.tsxbrowser-pane-linksprofile/extensions.ts,extension-api/browser-extensions,browser-sec-ext,browser-ext-fixplugin-browser/src/tools.ts,chromium.ts,snapshot.tsbrowser-tool-fixes,hidden-screenshot,browser-fix-tools,browser-deep-snapshotplugin-browser/src/connection.ts,policy.ts,core/src/permission.tsbrowser-deny,browser-sec-agent,browser-deny-listingelectron-builder.config.tscookie-encryption,browser-fix-fusesFollow-ups
GrantFileProtocolExtraPrivilegesoff.findandsnapshoton very large pages.packages/desktop/script/pack.ts.Added by the opencode bot (AI-generated).
Fixes #53580
Related: #52419
Public API: adds experimental GET /api/experimental/preview/read (503 file_verification_unavailable when handles cannot be verified), experimental.approved/approvedSave on the permission.evaluate hook, a deny-only permission experimental.rules hook, and Browser.experimental.open/close tab handles for GUI plugins (stable Browser.open unchanged); browser tools honour configured browser rules, hide from agents that deny them, and reject unknown parameters; codemode toolCalls gain optional error (all additive)