Skip to content

feat(desktop): signed-in browser pane with extensions, previews, prompts and agent safeguards - #63002

Open
Hona wants to merge 476 commits into
devfrom
persisted-browser
Open

Hona wants to merge 476 commits into
devfrom
persisted-browser

Conversation

@Hona

@Hona Hona commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

What you can do now

  • Click a link in the chat and you are already signed in. Web links open beside the conversation, in one profile that keeps your sign-ins.
  • Bring your sign-ins from your own browser in one click. The pane offers Chrome, Edge, Firefox, Safari and 11 others, or a cookie file, and you choose which sites.
  • Ask the agent about pages only you can see. It reads and drives the same signed-in tabs you use, on servers on this machine.
  • Decide what the agent may do. Set browser to ask and every call prompts with the site, the script or the files it wants.
  • See what the agent built, in the pane. Workspace HTML and agent artifacts open as real pages, from local and remote servers.
  • Keep working while it tests your app. The agent screenshots and clicks tabs that are not on screen.
  • Bring your extensions. Store extensions install after a review of what they can access; ad blockers block.
  • Use it like a browser. Right-click menu, find in page, reload without saved files, clearing one site's saved files, page dialogs, "Leave site?", permission prompts, HTTP sign-in and pop-up blocking. "Open in default browser" hands the page to your own browser.
  • Understand what went wrong. A page that cannot load says why in plain words, with Reload; a failed pane action offers "Try again".
  • Find settings quickly. Settings › Browser shows sign-ins, extensions and the links switch; everything else waits under "Advanced".
  • Your files stay yours. A previewed page reads only its own folder, never dot or secret files, and the agent also obeys your read rules.
  • Close the app and it is all still there. Sign-ins, tabs, extensions and site permissions come back after a restart.
Area Before After
Profile In-memory partition per attachment One persist:opencode-browser profile
Sign-ins Lost on restart or tab close Kept, encrypted; import from 15 browsers and files
Remote servers Signed out Signed out unless you share sign-ins
Links System browser Pane; modifier click keeps the system browser
Workspace HTML Native file: or a sandboxed iframe oc-preview: page, folder-scoped, local and remote
Agent artifacts Not viewable on desktop Open in the pane, one grant each
Browser chrome Select All only Native menu, find, reload without saved files, plain error pages, notices, pop-up blocking
Dialogs, permissions Electron's native box; everything denied In-app dialogs, permission bar, saved per site
Extensions None Signed store installs, review, popups
Agent tools 20.7% of 14,974 calls failed; snapshot cut at depth 8 Top error groups fixed or explained; snapshot and find at any depth
Agent limits Attach grant beat a configured deny A denying agent sees no browser tools; deny, input, ask, then reads
Chat links App schemes did nothing; authored markup could cover the app Reviewed app links; contained markup
Packaged app Plain-text cookies; runs as Node Encrypted cookies; no run-as-Node, no remote debugging in prod
browser-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.

Error group adais blade air vps Total After this PR
wait without condition 70 2,033 2 33 2,138 Condition read from the keys present
screenshot "needs a visible tab" 88 207 1 9 305 Captures hidden tabs
evaluate without script 81 55 3 1 140 expression, code accepted
[browser.disconnected] 38 27 2 13 80 Names the next step
Page JavaScript threw 16 52 - 12 80 Top-level return, await run
Message not stored 8 64 - - 72 Code Mode keeps toolCalls[].error
Invalid browser URL 3 55 - - 58 Names the value; points to preview
click UnknownVizError 7 31 - 5 43 Fixed
tab_unavailable 5 16 - 1 22 Lists open tab IDs
wait not met 9 8 - - 17 Returns met: false
60 s timeouts 11 9 2 4 26 Not addressed
  • Estimate, not measured after the change: about 2,290 errors become successful calls and about 160 become one precise message.

Community issues

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 --> tab
Loading

Profile and import

One persistent profile for the whole app; remote servers stay signed out unless you share.

  • Files: 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 under packages/gui-plugins/src/browser/).
  • Sources: 10 Chromium browsers, 4 Firefox family, Safari, and Netscape, Chrome-API JSON or Playwright files up to 32 MB.
  • Honest results: "Imported 1 cookie. Not imported: 1." Chrome and Edge v20 app-bound cookies get their own line.
  • Helpers by absolute path: powershell.exe under %SystemRoot%, /usr/bin/security, secret-tool from /usr/bin or /bin. No shell, 60 s kill.
  • macOS Keychain: the prompt names "security". The app says to choose Allow, not Always Allow.
  • Cannot save sign-ins: a start-up probe cookie detects a denied key store, warns, and turns import off.
  • Remote sharing: "Share sign-ins with remote servers", off and global. While on, cookies mirror both ways by state comparison. Off removes the shared cookies.
  • Sign out everywhere: clears sites, cookies, caches, HTTP sign-ins and linked partitions. Extension service workers survive so their menus keep working.
  • One button per browser: "Import…" opens "Import from " with "Import all"; "Choose sites" reveals the list in the same dialog.
  • Choose sites (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 › Browser (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.
  • Browser icons: on Windows they are extracted at 64 px and found through App Paths.
  • Passkeys (webauthn-gate.ts, passkey-groups.ts): requests fail fast on macOS and Linux, and in agent-driven tabs everywhere.
    • A notice explains it; its "Import sign-in" button opens the chooser on that site.
    • On Windows, a person's own tab keeps the system passkey dialog.

Links

Plain clicks on web links open in the pane; everything else keeps its old target.

  • Chat: createWebLinks in packages/app/src/runtime/plugin/render.tsx and web-href.ts take absolute http(s):// links only.
  • Terminal: 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.
  • OSC 8 links: a confirmation shows the real target before anything opens.
  • Setting: Settings › Browser › "Open links in OpenCode's browser".
  • App-scheme chat links (packages/app/src/runtime/plugin/app-links.ts): a real click shows the pane's confirmation with the full target.
    • Printable ASCII up to 200 characters; the review expires after 60 s.
    • Editor and IDE schemes are Copy-only; obsidian opens open and search only; mailto only without attachments.
  • Authored markup (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.
    • The app's own renderer output is unchanged: 12 of 13 comparison screenshots are byte-identical.

Local and remote previews and artifacts

Every workspace HTML page and artifact loads through one handler on a random per-grant origin.

  • Files: 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.
  • Desktop routing: HTML from the file tree, Open file, chat links and browser.preview opens in the pane. The sandboxed iframe stays only in the web app. The pane menu has "View source".
  • Why not file:: a worker made by a file: page reads any local file past webRequest. That gap exists on dev too.
A previewed page can A previewed page cannot
Load files in its own folder and below Load a parent folder, dot path or secret-named file
Run workers, modules, worklets, media with seeking Register a service worker or load file:/// URLs
Follow relative links and pushState to real files Run extension content scripts
  • Folder grant: the opened document's folder, pinned at open. Refused names: dot components below the root, id_rsa and friends, credentials, secrets.*, .pem, .key, .pfx, .p12.
  • Open-handle reads: the handler opens the file, checks the kernel-reported path, then streams from that handle. A swap after the check cannot redirect the read.
  • Remote: GET /api/experimental/preview/read, session-scoped, same rules on the server. Older servers fail closed with "Update this session's server".
  • Addresses: local pages show file:, remote pages workspace://<session>/<path>, artifacts artifact://<id>/<path>. Only real workspace files become a shown address.
  • Agent-driven previews: every request is also checked against the session's read and external_directory rules. Ask and deny return no bytes.
  • Takeover: the first agent call on a user preview reloads it on a new origin with no old storage, and returns document_changed.
  • Artifacts: CSP sandbox, Connection-Allowlist: (response-origin);webrtc=block, no popups, forms or navigation away. A clicked link asks before it opens.
  • Native file:: refused in every web contents of the profile and remote partitions (session-guard.ts).
  • Verification unavailable: when the handle check cannot load, preview and artifact reads answer 503 file_verification_unavailable, and the pane and agent show a distinct message. A missing file stays 404.
  • Native binding (packages/util/src/handle-path.ts, file-verification.ts):
    • The compiled CLI embeds only the target's binding (packages/cli/script/build.ts).
    • workerd gets no native resolver, so contained reads are refused there.
    • The desktop afterPack hook 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"]
Loading

Browser chrome

The pane now behaves like a browser around the page.

  • Right-click: page-menu.ts, native-page-menu.ts. Navigation, link, image, edit and spelling items, plus extension items for pages they may see.
  • Find: 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.
  • Refused navigations: refusal-notice.ts, notice-actions.ts. One notice per tab with the real target.
    • Open for 24 app-link schemes (mailto, slack, vscode, zoommtg …); Copy link otherwise.
    • Agent-caused targets get Copy link only.
  • Pop-ups: a window.open without user activation is blocked with "Pop-up blocked" and an Open action.
  • Host display: host-display.ts elides long hosts from the left, keeping the registrable domain. IDN shows as punycode.
  • Activation delay: activation-delay.ts. Buttons on bars and dialogs ignore presses for 500 ms after they appear.
  • Toolbar (panel.tsx, bar.css): back, forward, reload, the address with site information inside it, Extensions (a puzzle piece, for browser extensions only) and "⋯".
  • Menu: Find in page, Zoom as one row, Copy link, Add page to session, "More tools" (Comment on part of the page, Open in default browser, Reload without saved files, Clear history) and Browser settings.
  • Site information: a status line first; cookies, saved files and permissions under "Site settings".
  • Errors: a page that cannot load shows only an in-page message in plain words, with Reload and the technical code small underneath. The "Request failed" strip under the address bar is gone. A failed pane command gets a specific notice with "Try again".
  • Plain language: 83 strings reworded for a non-technical reader (i18n/en.ts).
Before After
Load unpacked Add from a folder
Reload ignoring cache Reload without saved files
Clear cache for this site Clear saved files for this site ("You stay signed in.")
Limited support May not fully work here
  • Reload without saved files: Ctrl+F5, or Cmd+Option+R on macOS (rebindable), Shift-click on Reload, More tools and the View menu.
  • Clear saved files for this site: origin-scoped; cookies and site data stay.
  • Open in default browser (default-browser.ts): a manual item for the current page or a local HTML preview, launched through the https handler. Only the person's click triggers it; previews and links still open in the pane.
  • Agent pages: the pane opens by itself only for an agent preview or tabs.open with focus: true, and never takes focus.
    • The person's selected tab is kept; the agent's tab gets an activity mark.
    • Settings › Browser › Advanced › "Open the browser when the agent shows a page" turns it off.
  • Native view placement (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.

  • Files: page-prompts.ts, prompt-machine.ts, prompts.tsx, site-permissions.ts, site-auth.ts, media-gate.ts, system-media.ts.
  • Dialogs: takeDialogs replaces Electron's internal -run-dialog listener and answers over CDP.
    • alert, confirm and prompt draw in the tab; frames are named "An embedded page at …".
    • "Stop this page from showing more dialogs" from the second repeat.
    • User or agent: the first answer wins.
    • A focused prompt owns the keyboard: app and pane shortcuts do nothing inside. F6 and the address-bar shortcut leave without cancelling. AltGr characters, non-Latin layouts and IME composition work.
  • Leave site?: for the user's navigations and tab closes. Agent navigations skip it.
Request Web page Agent-driven tab
Camera, microphone, location, notifications, clipboard read Bar: Never, Allow this time, Always allow Block or Allow this time only; denied after 20 s
Clipboard write Secure same-origin pages Refused
Anything else, cross-origin frames, insecure origins Denied Denied
  • Saved decisions: Settings › Browser › Advanced › Site permissions lists, changes and forgets them. Previews are never kept; remote partitions keep until you quit.
  • macOS media: media-gate.ts holds getUserMedia until you answer, so macOS asks after the bar. The bundle declares camera and microphone usage.
  • HTTP sign-in: top-level or same-origin only; three tries. The agent gets sign_in_required and never sees the credentials.
  • Client certificates: requests are cancelled; no certificate is ever sent.

Extensions

Store packages are verified, reviewed and pinned before they run.

  • Files: profile/extensions.ts, install.ts, review.ts, integrity.ts, compatibility.ts, filter-startup.ts, profile/extension-api/.
  • Download: HTTPS only to the store hosts, 128 MB cap, 90 s. Edge's HTTP names map to its TLS hosts.
  • CRX3: every RSA or ECDSA proof is verified; the signer must hash to the listing ID.
  • Add an extension: a store link, or your other browsers' extensions. "Add from a folder" sits under a closed "For developers".
  • Review: one of three plain verdicts ("Works here", "May not fully work here", "Probably won't work here") and one sentence; capabilities, sites and source under "Details". A one-use token installs exactly the staged package that was reviewed. Updates show new access.
  • Icons: an extension that declares icons only for its toolbar button shows them, and the sharpest fitting size is chosen; one with none gets a puzzle piece.
  • Unpacked installs: copied into app storage with an app-assigned ID.
  • On disk: file digests are checked at start. A changed package does not load: "Files changed on disk or were never verified."
  • Pages: an extension's API opens only its own package. Web pages and other extensions cannot load its private pages.
  • Popups: on a click only, own pages only; action.openPopup refused.
  • Background events: a FIFO per extension wakes a stopped worker or event page; install and update events fire on approval.
  • APIs: tabs, windows, action, webNavigation, contextMenus, cookies, notifications, storage.sync (quotas) are real. Others are stubs or Electron's own.
  • Private tabs: a tab whose URL is not revealed never matches a url or title filter. Unfiltered, active and window queries still return it redacted. A private tab without a url in a url query made uBlock Origin throw during startup and then pass every request.
  • Other redaction: action.onClicked shows tab details only with activeTab or existing access, and skips private tabs. Frames inside private tabs are not reported to webNavigation; no empty tabs.onUpdated.
  • Blockers first: local-profile http(s) navigations wait for request-filtering extensions to start.
    • All such extensions in parallel, up to one shared 5 s deadline; then pages load and nothing is unloaded.
    • Measured cold start of uBlock Origin plus Lite: 4.19 s median, 4.31 s worst of 10.
    • Previews, artifacts, remote tabs, pane registration and agent tools never wait.
    • Stop, a newer navigation, reload, back and forward cancel or join a pending load. Stop, Back and Forward keep the saved address and never show a typed address over another document.
    • An MV2 blocker whose internals are not the expected shape falls back to the generic signal at once and logs once.
  • Stylesheets (extension-api/styles.ts): tabs.insertCSS and removeCSS for 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.
  • Self-closing popups (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.
First ad blocked after a restart, restored and new tabs Before After
uBlock Origin 0 of 3 3 of 3
uBlock Origin Lite - 3 of 3
Both - 3 of 3
Extension Verdict Latest live result
uBlock Origin Lite partial Signature verified; blocks; popup (Windows, macOS)
uBlock Origin (Edge) supported Signature verified; blocks after restarts (Windows, macOS); hides ad slots with no console errors (macOS); popup (Windows)
JSON Formatter supported Formats web JSON (Windows, macOS)
Dark Reader partial Install, review, popup (Windows, earlier run)
Bitwarden, 1Password partial Start; sign-in or welcome page only (Windows, earlier run)

Agent browser tools

The tools accept what models write, answer fast, and say what to do next.

  • Files: 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.
Call Before After
wait {tabID, text, timeout} condition: Missing key Text wait, capped at 30 s
wait {tabID, timeout} same Pause
wait that times out Throws met: false, observed
evaluate {tabID, expression} script: Missing key Runs; await x returns its value
snapshot {tabID} Depth 8, 500 lines Any depth, 20,000-character budget
snapshot {tabID, interactive, maxLines} Unknown keys dropped Controls only; line cap
find {tabID, query} text: Missing key Runs (query is an alias of text)
network.get {id, includeResponseBody} Unknown key dropped Response body only
reload {tabID, ignoreCache} Unknown key dropped Reload ignoring the cache
tabs.list {} without a desktop Throws connected: false with guidance
preview of HTML { path } { path, tabID, url }, also off screen
preview of a missing path Success Fails with the absolute path
preview of a path outside the workspace Success Fails: "cannot show a file outside this session's workspace"
  • Snapshot and find (snapshot.ts): refs at any depth within maxChars (default 20,000) and maxLines; interactive: true lists controls only.
    • A quarter of the budget keeps headings and the opening text. Long collections are summarised only when truncated.
    • A truncation footer says what to do next. Refs survive follow-up calls until the document resets.
    • Unknown parameters still fail with the valid list.
  • Field values (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 it type="text"), a file input, masked with -webkit-text-security, has autocomplete current-password, new-password, one-time-code or any cc-*, or whose accessible name, id, name, placeholder, aria-label or label says password, passcode, PIN, OTP, CVV, CVC, card number, secret, token or SSN prints value=<hidden> instead, and an empty field prints no value.
Default snapshot, refs / headings / opening text Before the heading budget (d44e103611) After
Deep nesting 500/500, 2/2, yes 500/500, 2/2, yes
2,000-row table 625/2000, 0/1, no 618/2000, 1/1, yes
Shadow DOM 168/184, 9/9, yes 168/184, 9/9, yes
Hacker News 229/230, -, - 229/230, -, -
GitHub 282/304, 11/25, no 282/304, 22/25, yes
Docs 424/1278, 0/45, no 327/1278, 40/45, yes
Article 452/579, 0/16, no 346/579, 10/16, yes
  • Both sides already reach every depth; find reaches 1,277 of 1,278 docs controls and 577 of 579 article controls after.
  • Not attached: every tool but tabs.list throws [browser.not_attached].
  • Redirects: a navigation superseded by a redirect reports where the tab ended.
  • Hidden tabs (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.
  • Full-page screenshots work on background tabs, with a 15 s deadline; the capture resizes the page once.
  • Fresh screenshots: a capture holds a compositor-frame subscription and returns a redraw from Page.captureScreenshot.
    • No frame in time fails with the clear timeout; frames across a document status change are rejected.
    • Element crops are computed in captured pixels and clamped.
    • A restored tab that never opened its page says so.
Never-shown tab, page updated itself Stale at ce772bc1ac Stale after
Windows, app window covered 50 of 50 0 of 50
macOS, every window state 30 of 30 0 of 30
Cross-origin iframe in it - 0 of 30, Windows and macOS
Capture cost, median ce772bc1ac After
Windows viewport PNG 37 ms 47 ms
Windows element 47 ms 51 ms
Windows hidden covered tab 37 ms 43 ms
Windows JPEG 37 ms 49 ms
macOS visible-tab PNG 67 ms 48 ms
  • Both baselines are ce772bc1ac, a commit of this branch that already captured hidden tabs; on dev the same screenshot is refused with "needs a visible tab".
  • Windows figures are paired runs; about 13 ms is the wait for the redraw to be presented. The macOS run covered the first two capture commits.
  • Failure codes: condition_unmet, document_changed, stale_ref, preview_unavailable, sign_in_required.
  • Replies: every reply is validated before sending. An unencodable one fails as [browser.invalid_result] instead of a 60 s timeout.
  • Restored sessions answer at once after a restart or reconnect.
  • Workers: child targets are released after attach, so page workers run.

Agent limits and permissions

The agent acts only where your rules allow, and never as you at the OS level.

// packages/plugin-browser/src/tools.ts, every call
refuse(tool, input.type)        // 1. configured deny, before anything is read
parse(input)                    // 2. the call's own input
authorize(tool, action, paths)  // 3. ask / tool.use / saved: site, script, destination or paths
// not attached: tabs.list answers connected: false; any other call throws [browser.not_attached]
// 4. preview: read on the named and physical path; upload: read + external_directory
// 5. tab lookup, request; exports: edit on the generated files
  • Prompt and save: prompts name the site, up to 320 script characters, the destination or the paths. "Allow always" saves operation plus site; scripts and destinations add a SHA-256 digest.
  • Rules: a permission.evaluate hook applies per-operation deny and ask with core's matcher (Wildcard.match, packages/schema/src/wildcard.ts). Missing or disabled agents are denied.
  • Listing: an agent whose rules deny the browser sees no browser tools and no built-in browser skill.
    • Core builds one ruleset for listing and calling (Permission.rules, packages/core/src/permission.ts).
    • The browser plugin adds its deny through a deny-only experimental.rules hook.
    • The Code Mode catalog cache is keyed by the visible tool set.
Code Mode step, 3,000 tools, two agents alternating Before After
Tool.snapshot, median of 20 steps 92.7 ms 1.3 ms
  • Hooks keep their ask: core passes experimental.approved and approvedSave on the event (packages/plugin/src/{effect,promise}/permission.ts).
  • Grants: subagents lose the inherited grant before their first prompt; grants of killed servers are revoked at start.
  • Input: clipboard and context-menu chords are refused. evaluate gets no manufactured user gesture.
  • Dispatch check: each click hit-tests the point and node just before sending; keys check the focused frame and its ancestors.
  • App shortcuts: debugger-flagged agent keys never reach the shell, find, reload or zoom.
  • Agent-driven tabs: a tab stays agent-driven until the person clicks, types or runs a command in it. The mark is saved with the tab, restored before its first document, and inherited by pop-ups. Kept site permissions do not apply there, and passkey requests are refused in the browser process.
  • Downloads: captured for the agent only in an agent-driven tab, never from an extension page; yours use the save dialog.
  • File pickers: agent-caused choosers are cancelled with a pointer to files.upload.
  • Extensions: extension pages and every frame under one are refused; their console and network entries are left out.
  • Exports: written to a session-specific cache that is deleted with the session.

Cookie encryption and fuses

Packaged builds encrypt cookies and close the plain-Node and debugger paths to the key.

Setting (packages/desktop/electron-builder.config.ts) dev beta prod
EnableCookieEncryption on on on
RunAsNode off off off
EnableNodeCliInspectArguments off on off
EnableNodeOptionsEnvironmentVariable on on on
Remote-debugging switches, packaged (src/main/diagnostics/options.ts) ignored kept ignored
  • NODE_OPTIONS stays: packaged apps ignore all but two options, and off would strip NODE_EXTRA_CA_CERTS from the CLI.
  • Unsigned macOS builds are re-signed ad hoc after the flip.
  • One-way: a downgrade or turning encryption off signs you out of sites.
  • What a local attacker can still do: swap app.asar; decrypt cookies as the same Windows user (DPAPI); start Beta with --inspect.

Verification

Area Windows dev macOS dev Linux headless
Preview boundary, folder rule, swap loops pass pass pass (matrix, handler)
Remote previews, artifacts, restore, reconnect pass pass not run
Dialogs, Leave site?, permissions, sign-in pass pass (media gate, no OS prompt) real-Electron tests only
Right-click, find, notices, pop-ups pass pass not run
Extensions: signed install, review, digests, events pass pass, without events not run
Agent limits: chords, keys, pickers, uploads, read rules pass pass (chords, keys) not run
Hidden tabs, restored sessions pass pass not run
  • Last live runs:
    • Windows: acceptance at b8d2153b27; the extension and screenshot fixes live on their own commits.
    • macOS: 5dea41d59b for the main pass, ce772bc1ac for packaging (static), and a final pass at 9e20e99a4f:
      • Screenshots of never-shown tabs: 0 stale of 60 (PNG and JPEG, window in front and covered).
      • uBlock Origin blocked 6 of 6 loads across three restarts, in restored and new tabs. Off and on in Settings with a preview open stays blocked.
      • A reload during the startup wait loads the saved address once; previews do not wait.
    • macOS at 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.
    • macOS at 5361344011: a typed file:// 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.
  • Two final reviews (security and code) of the merged batch: no merge dropped a guarantee. Their findings are fixed in the commits after 53eebb7b55.
  • Alignment audit of the simplified UI (dda8584328, measured in the running app with getBoundingClientRect(), 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.
  • At dda8584328, 763 browser tests and 101 component specs pass.
  • Every real-Electron test starts through one runner (packages/gui-plugins/src/browser/electron-run.ts) that cannot show a native dialog and survives the Linux first-use install race.
  • Unit suites, including the three real-Electron tests, pass on all three systems.
  • Packaged builds: Windows x64 and macOS arm64 and x64 contain exactly one binding each. The binding loads under plain Node from the packaged layout on Windows x64 and macOS arm64. The compiled CLI is checked on macOS arm64 and x64 and Linux x64. Earlier a packed macOS beta launched.
  • CI: full tier green on the PR head e2ce09f782 (run 44040193529, 15 of 15 jobs on the first attempt), and all 7 PR checks pass. That head includes the latest dev, merged with one conflict in packages/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 on 5361344011 (run 44006197713, 15 of 15 jobs on the first attempt, all 7 PR checks passing) and on 53eebb7b55 (run 43998022742, 15 of 15, first attempt).
    • Across earlier runs, three tests this PR does not touch failed once on slow runners and passed on re-run: 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 on dev and here, 10 runs each) and packages/app/e2e/regression/review.spec.ts:1159 (also flaky on dev'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.
  • The video's ad-blocking beat uses uBlock Origin Lite, because the recording found the uBlock Origin startup defect fixed under Extensions.

Not verified:

  • Chromium import "Allow" and encrypted cookie rows on macOS.
  • Password managers with a signed-in account.
  • Sign-ins surviving a restart on Linux (desktop(browser): session cookies not persisted in v2.2.0 (upgrade to v2 did not fix #50382) #60313): verified live on Windows and macOS only.
  • Remote sign-in sharing against a real remote server.
  • A launched packaged build on any OS since the media and debugging changes; a packed Linux desktop package; a load proof of the macOS x64 binding.
  • Linux: dialogs, prompts, extensions, chrome and OS hand-offs in a real desktop session.
  • Real camera, microphone and location grants; Digest and NTLM sign-in; a tampered CRX from a store.
  • Picking an element with uBlock Origin's picker, and the picker's own close button (it did not close it); native-menu shortcuts with real key presses.

Known limits

  • Extensions in agent tabs: extension UI in the page DOM is page content. The agent can trigger an autofill and read the field.
  • Moving extension overlays: a frame that moves between the hit check and the click can still be hit.
  • Clipboard: for about 5 s after an agent click, page script can overwrite the clipboard. It cannot read it.
  • Print: an agent-run script can open the native print dialog.
  • Restart: a session not on screen after a restart has no browser tools until opened. After a configuration reload, for about 20 s.
  • Network log: the agent sees request and response bodies of signed-in pages; only cookie and authorization headers are redacted.
  • Attachment: any holder of the server credential who learns the connection ID can drive an attached browser.
  • Remote tunnel: no destination policy; remote pages reach the server's loopback.
  • Hard links: a hard link inside the workspace serves the file it points to.
  • Updates: installed extensions update only when you add them again.
  • Embedded frames in previews: an extension running in a web frame inside a private preview learns that preview's address and title through the native sender.tab. For a local preview this includes the file's path.
    • Electron builds sender.tab natively; Chrome does the same for a frame inside a file: page.
    • Only extensions with access to the embedded site.
  • MV3 scripting: MV3 extensions can reach a web frame embedded in a private preview through native scripting; the preload guard is advisory.
  • MV2 stylesheets: Electron 44 cannot remove an inserted user-origin style sheet from a live page. Hidden elements stay hidden until reload.
  • Blocker start-up: native pop-ups, 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.
  • Unrecognised blockers: when readiness cannot be recognised, the first page after a cold start can load before filtering starts, as before this PR.
  • Hidden agent tabs: a tab the agent has used stays un-throttled while hidden for 30 s after its last command.
  • Policy listing: a managed tool.use policy deny still lists the browser tools; calls are refused.
  • Huge pages: find and snapshot on a page of about 100,000 nodes stall the app's main process for about 2 s, the same as before this PR.
  • /var spelling on macOS: a file:///var/… address of a workspace file is refused as outside, because /var links to /private/var. The /private/var/… spelling works.
  • Passkeys: on Windows a tab the agent has driven refuses passkeys for the rest of its life. Real passkey support on macOS needs a newer Electron and a browser entitlement.
  • Found, not fixed: a chat link whose label holds display math with text around it can hang layout (the ingredients are on dev). Back after Stop on a held restore can lead to a blank page.
  • Browser icons: on Linux, and for Arc on Windows, import rows still show a globe.
  • Site settings: the view has no per-site permission picker; saved answers are changed in Settings.
  • Screenshots: the native right-click menu is not among them.
  • Linux: live coverage is partial.

Notes for review

  • Behaviour changes:
    • Adding an extension stops once for a review.
    • Your downloads in the pane use the save dialog.
    • Remote servers' pages are signed out unless you share sign-ins.
    • Previews load only from the document's folder: no parent folders, dot or secret-named files.
    • Agent previews are slower: about +40% for 350 resources, from per-file rule checks.
    • evaluate has no user gesture; clipboard chords are refused.
    • wait returns met: false; unknown parameters are rejected; tool schemas change.
    • A configured ask prompts, with site and script.
    • Packaged prod ignores remote debugging; benchmark startup against Beta.
    • Sign out everywhere also clears extension pages' storage; only their service workers stay.
    • An agent whose rules deny the browser no longer sees the browser tools or skill.
    • A tab stays agent-driven until the person acts in it; there is no 30 s hand-back.
    • The pane may open by itself for an agent preview or tabs.open with focus: true; a setting turns it off.
    • Snapshots print filled form values, except sensitive fields; their output and size change.
    • Model- and tool-written HTML in the chat loses positioning, pop-overs, commands and dialogs.
  • Security fix in the chat: markup in a message or in tool output could enter the top layer or take clicks meant for the permission prompt and the composer.
    • packages/app/component-tests/session-containment.spec.ts fails 10 of 14 cases on the previous filter, which is byte-identical on dev, and passes 14 of 14 here.
Input (as text and as tool output) Previous filter This PR
Block anchor card pass pass
Fixed transparent anchor over the app fail pass
Popover cover fail pass
Invoker dialog fail pass
Fixed tint fail pass
Author-sized math fail pass
Legitimate table, image, coloured span pass pass
  • Experimental API: GET /api/experimental/preview/read (client.experimental.preview.read; 503 file_verification_unavailable when handles cannot be verified), experimental.approved and approvedSave on permission.evaluate, and a deny-only permission experimental.rules hook.
  • GUI plugin API:
    • Browser.experimental.open returns a branded handle, and experimental.close closes only that plugin's tab. It rejects when the session is not on screen. Stable Browser.open is unchanged.
    • ctx.system.openExternal launches only http(s) and mailto: URLs; file: URLs and plain paths now do nothing. Use ctx.desktop.launch(path) to open a file.
  • Electron internals: the dialog takeover replaces Electron's -run-dialog listener. electron-dialogs.test.ts fails if Electron changes it.
  • refactor(browser): serve the in-app browser's tools from the desktop over client MCP #59477 (client MCP draft) would move the tool-side code and drop the grant fixes.
  • No feature flag: GUI plugins cannot read server flags, and the fuses are one-way build settings.

How to review by area (447 files, +36,578 / −3,113 against dev):

Area Read first Side branch
Profile, import, sharing, passkeys profile/index.ts, link.ts, profile/sites.ts, webauthn-gate.ts persisted-browser itself, browser-site-import
Previews, artifacts profile/serve.ts, util/src/preview-scope.ts browser-html-preview, browser-sec-preview
Chrome, dialogs, permissions page-prompts.ts, page-menu.ts, default-browser.ts browser-prompts, browser-prompt-keys, browser-pane-open; menu and find on persisted-browser
Chat links and markup app/src/runtime/plugin/app-links.ts, markdown-cache.tsx browser-pane-links
Extensions profile/extensions.ts, extension-api/ browser-extensions, browser-sec-ext, browser-ext-fix
Agent tools plugin-browser/src/tools.ts, chromium.ts, snapshot.ts browser-tool-fixes, hidden-screenshot, browser-fix-tools, browser-deep-snapshot
Agent limits plugin-browser/src/connection.ts, policy.ts, core/src/permission.ts browser-deny, browser-sec-agent, browser-deny-listing
Fuses electron-builder.config.ts cookie-encryption, browser-fix-fuses

Follow-ups

  • An extension-free view for agent automation, to separate extensions from the agent.
  • Native Keychain read, so the prompt names OpenCode.
  • Asar integrity fuses and GrantFileProtocolExtraPrivileges off.
  • A timeline card for artifacts.
  • Downloads list, DevTools, real passkeys and other tab features.
  • Renderer-side candidate selection for find and snapshot on very large pages.
  • Per-server sign-in sharing and a signed attachment capability.
  • Browser tools for sessions not yet opened after a restart.
  • A per-channel updater cache name in packages/desktop/script/pack.ts.
  • A cancellable check before the native print dialog.
  • A background updater for extensions.

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)

@Hona
Hona requested a review from Brendonovich as a code owner November 10, 2026 01:41
Copilot AI balanced review requested due to automatic review settings November 10, 2026 01:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@esafak

esafak commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

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.

@Hona

Hona commented Nov 10, 2026

Copy link
Copy Markdown
Member Author

hmm cool idea @esafak.. I'll explore that

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 execute metadata: toolCalls[] gains an optional error.
  • Browser tools now call the permission check with action browser and the operation as resource. Configured browser denies, asks and per-operation rules now apply, and permission.evaluate hooks see browser calls.
  • Browser tools reject unknown parameters.
  • browser.evaluate accepts expression/code.
  • browser.wait infers 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.html doesn't stat (a backslash is a valid filename character there). The suffix search then finds the file, because it normalizes \ to /, but absolute keeps the raw backslash. The new test fails here: it expects <dir>/site/index.html and gets <dir>/site\index.html. Without a desktop connected, that wrong path is the one preview reports to the user. Normalizing \ to / in plain before resolving it (and before the suffix search) would fix both.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Hona Hona changed the title feat(desktop): one persistent browser profile with imported sign-ins, extensions and in-pane links feat(desktop): persistent browser profile, extensions and agent tool fixes Nov 13, 2026

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.evaluate hook event: new optional, read-only experimental.approved (effect and promise plugin types).
  • @opencode/schema: new Wildcard.match export.
  • @opencode/app: new loopback export.
  • From earlier commits: browser tools follow configured browser permission rules and reject unknown parameters; code mode toolCalls[] gains an optional error.

Nothing new to raise.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Hona added 11 commits November 17, 2026 12:28
…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.
…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.
Hona added 13 commits November 17, 2026 13:39
…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.
Hona added 4 commits November 18, 2026 09:24
…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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants