Skip to content

feat(browser-pane): wire MV3 extension lifecycle, DNR filter gate, popup surface, and restart-restore - #283

Merged
Hona merged 7 commits into
devfrom
ws9/pr3-pane-extensions
Nov 21, 2026
Merged

Hona merged 7 commits into
devfrom
ws9/pr3-pane-extensions

Conversation

@Hona

@Hona Hona commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Brings MV3 browser extension lifecycle (crates/browser-pane), per-user desktop extension management (apps/desktop), and official-parity Settings › Browser › Extensions UI (plugins/browser) onto dev (1dc6a786, incl. #280, #274, #296, #301, #303, #305, #298, #312, #316). Held unmerged until the mandatory shipping gate clears.

Changes

  • browser-pane extension lifecycle, DNR filter gate, popup surface, and restart-restore (crates/browser-pane/src/{protocol,machine,client,find,extensions,sidecar,transport,preview,prompts/host}.rs):
    • Wires HostMsg::Hello.extensions, HostMsg::OpenTab.{allow_extension_pages, is_popup, ext_open_request_id} on #288's ContextKind (always allow_extension_pages: false, is_popup: false on agent/isolated tabs), ClickExtension, ListExtensions, UninstallExtension, ReloadExtension, CancelExtensionOpenTab, Ready.extensions, and EngineMsg::Extension* (all wire fields #[serde(default)] / skip_serializing_if).
    • Passes verified --extension <id>:<sha256>:<dir> specs on spawn (transport.rs), implements explicit FilterGateState (Ready | PendingReady | Waiting), anchored OSR PopupState with [25..800]×[25..600] RTL-aware popup_bounds(), bounded ExtensionOpenTab queue (<= 16), zero-restart disable/re-enable, and transparent sidecar restart-and-restore.
  • Desktop extension runtime & strictly user-scoped Luau bridge (apps/desktop/src/surfaces/browser/extensions.rs, apps/desktop/src/plugin_host/native/browser/{extensions,web}.rs):
    • Registers BROWSER_EXTENSIONS in an opencode_kernel::Slot inside BrowserFeature (zero new struct App fields).
    • Constructs ExtensionManager strictly via ExtensionManager::in_user_data(&crate::dirs::data()) (never ExtensionManager::new; sweeps .staging-* once; refuses unattended non-rooted runs).
    • Drives staging/review/swap strictly through InstallMachine::step with a monotonic Instant-derived clock (now_ms()), running CRX3 download, unpack, copy, and swap off the UI thread (rune_luau::spawn_blocking), unloading running copies before swap on Windows, and persisting StoredExtension via opencode-storage (plugin.browser/extensions) only after swap succeeds.
    • Restricts EVERY Browser:Ext* sync/async method to scope.is_builtin_browser && scope.tool_sid.is_none() && scope.in_flight.is_empty() (unreachable by MCP tools and third-party plugins); folder installs use Tx::open_folder (Luau never passes raw paths); errors map to stable catalog reason codes.
  • Official-parity Settings › Browser › Extensions UI (plugins/browser/{extensions.luau,settings.luau,init.luau,plugin.toml,locales/en.json,icons/puzzle.svg}):
    • Audited line-by-line against official opencode origin/dev b9a60d9d078d87bfb90f039e431090508f88ac02 (packages/gui-plugins/src/browser/{settings.tsx,settings-view.ts,choices.tsx,i18n/en.ts}, packages/ui/src/icons/catalog.ts:479, packages/app/src/settings/settings.css:777-803) and proof/reference/e51247f626/ws9/:
      • Extensions section (settings.tsx:130-153, 374-421): Section heading "Extensions", installed rows with 20×20 icon / puzzle.svg fallback (choices.tsx:24-40), version + middot + compatibility verdict (partial muted / unsupported warning amber + hover tooltip listing cause & missing features) or changed/error alert, outline-trash remove icon button + enable switch, bottom settings-browser-extensions "Add an extension" row with + Add button, and "Some extensions may not work here yet" footer note (gap: 16, page section stack gap: 32 matching settings.css:780,795).
      • Add an extension dialog (settings.tsx:432-748): Large store URL input + Add button, status/error banner, "From your browsers" header + Chromium profile selector popover + ChoiceRow list (minW = 96 Add / Add anyway / Added buttons, discovered only on explicit user click), hairline divider + collapsed "For developers" disclosure ("Load an extension from a folder." + "Choose folder"), and contrast "Done" footer.
      • InstallReview confirmation step (settings.tsx:524-535, 699-715, 750-840 + review-rd280.md): Icon + 'Add "{{name}}"?', "It can:" rendering every ExtensionAccess variant (allSites, someSites, cookies, activity, clipboard, proxy, blockRequests, manageExtensions, externalConnect, webAccessible), expandable "On these sites:" list, warning-highlighted "It now also wants to:" update delta, status-dot compatibility verdict + tooltip, unvetted local source warning, replaces notice, and hard-blocked Approve on ManifestV2 and DisallowedPermission.

Verification

  • scripts/guardrails.ps1: 5/5 passed (client.rs 1,455/1,500, engine.rs 1,423/1,500, 94/94 App fields, 0 files >800 in desktop/features/crates).
  • OPENCODE_RUNE_EMBED_PLUGINS=1 cargo.ps1 check --workspace: 0 warnings.
  • cargo.ps1 check -p browser-pane --no-default-features: 0 warnings.
  • scripts/web.ps1 -Check: 0 warnings (opencode-web + web clock across 1,042 files / 48 crates).
  • luau-lsp analyze (plugins/browser/{extensions,settings,init}.luau): 0 errors.

Mandatory Shipping Gate (review-rd274.md & review-rd280.md)

Extensions MUST NOT be enabled for users (this PR remains unmerged) until ALL SIX are on dev and independently confirmed:

  1. WS-9 PR #274 (engine MV3 host + fail-closed guard): MERGED to dev at 5da64743 (macOS live proof passed on air; waiting on newly published signed engine).
  2. WS-9 official-parity extension-isolation PR (built on landed #298 d6cf8659, design in notes/upstream-sync/status-ws9.md §10): pending design go & review.
  3. WS-9 PR #312 (1b-1, Find caller-scoping): MERGED to dev at 1dc6a786 (tree b1dbac8b).
  4. PREVIEWS PR #303 (engine-wide file:// ban & oc-preview:// routing): MERGED to dev at 6fb05ce1.
  5. WS-1's controlled-tab permission stopgap (#319): in review.
  6. Owner's go (and newly published signed engine).

Base automatically changed from ws9/pr2-browser-extensions-crate to dev November 20, 2026 14:28
Hona added a commit that referenced this pull request Nov 20, 2026
…18..UP-122 (#295)

- Fold verified fleet PRs #278, #285, #287, #288, #289, #290, #291, and
  #293 (Rune dc8f7f72: #1301, #1302 focus rescue verified Send+Enter -> effort)
  into docs/upstream-sync/ledger.{json,md}
- Close UP-062 packaged-default regression (#278), UP-095-UI / UP-100 /
  UP-106 / UP-109 / UP-117 (#285, #289), and PRE-08 (#287); reassign
  UP-115, UP-116, UP-075 to BROWSER-UI
- Add separate Reviewed column for browser rows tracking retrospective
  security reviews on merged PRs (#245, #268, #272, #277, #288, #275, #287,
  #285, #289) and pre-merge holds (#274, #280, #281, #283, #286, #292, #294,
  and BROWSER-TOOLS PR 3+)
- Audit upstream anomalyco/opencode bfee96a859..2002222d13 (+6 commits:
  1 skipped, 5 added: UP-118..UP-122) and refine radar routing
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

PR test build retired — merged into dev. Install or auto-update OpenCode (Rune) from https://anoma.ly/release/opencode/desktop-rune/dev/macos-arm64-dmg.

@Hona
Hona merged commit 519398c into dev Nov 21, 2026
@Hona
Hona deleted the ws9/pr3-pane-extensions branch November 21, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant