Skip to content

feat(browser): add autonomous native previews - #666

Open
pascalandr wants to merge 4 commits into
devfrom
feat/browser-automation
Open

feat(browser): add autonomous native previews#666
pascalandr wants to merge 4 commits into
devfrom
feat/browser-automation

Conversation

@pascalandr

@pascalandr pascalandr commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add autonomous native browser previews for Electron and Windows Tauri
  • expose codenomad.browser through the authenticated project-local Developer Mode adapter now present on dev
  • isolate persistent browser profiles and fence previews by OpenCode session, local-window ownership, navigation generation, and exact page-load expectations
  • keep the primary Tauri renderer authoritative after adding child WebViews, including command extraction, events, focus, menus, state flushes, navigation, and zoom
  • harden popup, permission, download, URL, deadline, stale-ref, duplicate-owner, replacement-typing, and multi-window open-claim handling

Scope

Developer Mode launch, CDP feedback, restart, lifecycle, and shared native transport live on dev. This PR adds browser previews and browser-specific extension points; it does not restore a separate browser plugin, route, launcher, or V1 runtime.

The branch remains temporarily stacked on #671 (fc206729) so its Linux automation-registry test isolation is present until #671 is squash-merged. The final rebase will retain only the four browser commits.

Validation

  • server, UI, and Electron typechecks
  • server browser/bridge tests: 6/6
  • UI browser policy/adapter tests: 9/9; the adapter test now runs in PR CI
  • Electron native suite: 204/204
  • Tauri browser-controller tests: 6/6
  • full Tauri suite: 146/146 twice consecutively under the normal parallel runner
  • cargo fmt --all -- --check, cargo check, and git diff --check
  • exact-head production build with npm run build:tauri
  • packaged Windows Tauri release at 6290822f72efb9a666cc64176eb244746caecbd3, SHA-256 45B1FB4834109988099611C8A82BF7DCD64660D03041F4A5950D70A09C7FD094
  • real WebView2 validation on a reachable local page: autonomous open, navigate, accessibility snapshot, replacement type, click, and PNG screenshot
  • Developer Mode { enabled: true, active: true }, managed CLI ready, exact OpenCode session restored, and codenomad.inspect / codenomad.screenshot operational while the child preview is open

Notes

The Linux cross-target check was not run manually because the local environment lacks x86_64-linux-gnu-gcc; the PR workflow covers Linux and Tauri Linux builds.

@pascalandr
pascalandr force-pushed the feat/browser-automation branch from 59b106f to 36e39fb Compare August 29, 2026 08:25
@pascalandr pascalandr changed the title feat(browser): add native previews and developer automation feat(browser): add autonomous native previews Aug 29, 2026
@pascalandr
pascalandr force-pushed the feat/browser-automation branch from 36e39fb to 8b6a471 Compare August 29, 2026 08:35
@github-actions

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/33243527867

Artifacts expire in 7 days.
Artifacts:

  • pr-666-8b6a471e2c2ed27b8e282868ea2e1df9b53b9089-tauri-macos
  • pr-666-8b6a471e2c2ed27b8e282868ea2e1df9b53b9089-tauri-windows
  • pr-666-8b6a471e2c2ed27b8e282868ea2e1df9b53b9089-tauri-linux
  • pr-666-8b6a471e2c2ed27b8e282868ea2e1df9b53b9089-electron-macos
  • pr-666-8b6a471e2c2ed27b8e282868ea2e1df9b53b9089-tauri-macos-arm64
  • pr-666-8b6a471e2c2ed27b8e282868ea2e1df9b53b9089-electron-linux
  • pr-666-8b6a471e2c2ed27b8e282868ea2e1df9b53b9089-electron-windows

Base automatically changed from DEV-v2 to dev September 4, 2026 10:36
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/33243527867

Artifacts expire in 7 days.
Artifacts:

  • pr-666-8b6a471e2c2ed27b8e282868ea2e1df9b53b9089-tauri-macos
  • pr-666-8b6a471e2c2ed27b8e282868ea2e1df9b53b9089-tauri-windows
  • pr-666-8b6a471e2c2ed27b8e282868ea2e1df9b53b9089-tauri-linux
  • pr-666-8b6a471e2c2ed27b8e282868ea2e1df9b53b9089-electron-macos
  • pr-666-8b6a471e2c2ed27b8e282868ea2e1df9b53b9089-tauri-macos-arm64
  • pr-666-8b6a471e2c2ed27b8e282868ea2e1df9b53b9089-electron-linux
  • pr-666-8b6a471e2c2ed27b8e282868ea2e1df9b53b9089-electron-windows

@pascalandr
pascalandr force-pushed the feat/browser-automation branch from 8b6a471 to adfc03f Compare September 4, 2026 12:14
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/33871760485

Artifacts expire in 7 days.
Artifacts:

  • pr-666-adfc03f39ffe627e843aea3a038254447d28656b-tauri-macos
  • pr-666-adfc03f39ffe627e843aea3a038254447d28656b-tauri-windows
  • pr-666-adfc03f39ffe627e843aea3a038254447d28656b-electron-macos
  • pr-666-adfc03f39ffe627e843aea3a038254447d28656b-tauri-macos-arm64
  • pr-666-adfc03f39ffe627e843aea3a038254447d28656b-electron-linux
  • pr-666-adfc03f39ffe627e843aea3a038254447d28656b-tauri-linux
  • pr-666-adfc03f39ffe627e843aea3a038254447d28656b-electron-windows

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/33878676695

Artifacts expire in 7 days.
Artifacts:

  • pr-666-6290822f72efb9a666cc64176eb244746caecbd3-tauri-macos
  • pr-666-6290822f72efb9a666cc64176eb244746caecbd3-tauri-windows
  • pr-666-6290822f72efb9a666cc64176eb244746caecbd3-electron-macos
  • pr-666-6290822f72efb9a666cc64176eb244746caecbd3-tauri-macos-arm64
  • pr-666-6290822f72efb9a666cc64176eb244746caecbd3-tauri-linux
  • pr-666-6290822f72efb9a666cc64176eb244746caecbd3-electron-linux
  • pr-666-6290822f72efb9a666cc64176eb244746caecbd3-electron-windows

1 similar comment
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/33878676695

Artifacts expire in 7 days.
Artifacts:

  • pr-666-6290822f72efb9a666cc64176eb244746caecbd3-tauri-macos
  • pr-666-6290822f72efb9a666cc64176eb244746caecbd3-tauri-windows
  • pr-666-6290822f72efb9a666cc64176eb244746caecbd3-electron-macos
  • pr-666-6290822f72efb9a666cc64176eb244746caecbd3-tauri-macos-arm64
  • pr-666-6290822f72efb9a666cc64176eb244746caecbd3-tauri-linux
  • pr-666-6290822f72efb9a666cc64176eb244746caecbd3-electron-linux
  • pr-666-6290822f72efb9a666cc64176eb244746caecbd3-electron-windows

Expose session-scoped browser open, navigate, snapshot, click, type, and screenshot actions through the existing authenticated CodeNomad automation adapter. Reuse the shared native request transport and session ownership fencing from Developer Automation instead of restoring a separate plugin or route.

Implement isolated persistent browser previews in Electron and Windows Tauri with hardened popup, permission, download, navigation, deadline, and stale-reference handling. Keep preview registration and open claims scoped to the owning CodeNomad session across windows.

Add the session preview UI, native adapters, localized labels, browser-specific architecture documentation, and focused Electron, Tauri, server, and UI coverage. Developer Automation launch, CDP feedback, and lifecycle code remain in DEV-v2 and are not duplicated here.
Apply rustfmt to the new browser command and navigation wiring in main.rs. No behavioral changes.
Create an agent-requested preview before switching the active session so Tauri never registers the previous workspace preview under the new session. Ignore transient registrations that are still loading another URL.

Allow failed or closing claim owners to release browser-open ownership and redistribute the request to another local window in both Electron and Tauri. Prevent the failed owner from immediately reclaiming the same request.

Fence Electron click dispatch against navigation before every mouse event, matching Tauri. Add focused regressions for claim transfer, stale click refs, and stale Tauri page-load expectations.
Route renderer commands, navigation, events, client-state flushes, and zoom through the primary Tauri Webview instead of requiring a WebviewWindow. Native window operations now derive the parent Window explicitly, and focus/menu targeting ignores browser child webviews so an open preview cannot displace the CodeNomad renderer.

Route agent-requested previews through the active instance when restored tabs expose the same OpenCode session more than once. Use Chromium's selectAll editing command and virtual key metadata before replacement typing in both desktop hosts, preserving clear semantics in WebView2.

Add Tauri, Electron, and UI regressions, run the browser adapter test in PR CI, and remove a redundant wall-clock assertion from the registration-contention test while retaining its behavior assertions. Validated with repeated 146-test Tauri runs, the 204-test Electron native suite, desktop typechecks, a release Tauri build, and packaged WebView2 open/navigate/snapshot/type/click/screenshot actions.
@pascalandr
pascalandr force-pushed the feat/browser-automation branch from 6290822 to 47a56f2 Compare September 6, 2026 21:11
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