|
| 1 | +# Browser and CUA verification |
| 2 | + |
| 3 | +Last verified: 2026-08-21 on Apple Silicon macOS. |
| 4 | + |
| 5 | +## Implemented surface |
| 6 | + |
| 7 | +- A Bun NDJSON sidecar owns the persistent Chrome-for-Testing profile, tabs, |
| 8 | + structured CDP actions, input, downloads policy, and screencast frames. |
| 9 | +- The Workspace Browser panel and GJC agent bridge share the same session tabs. |
| 10 | +- Browser HTTP automation is available at `/api/browser/:sessionId`; the first |
| 11 | + PoC `/api/automation/browser/:sessionId` routes remain as compatibility aliases. |
| 12 | +- `npm run browser:debug` is an HTTP-only client for the running server. It does |
| 13 | + not launch Chromium and accepts the desktop cookie through |
| 14 | + `GAJAE_BROWSER_DEBUG_COOKIE` when desktop authentication is enabled. |
| 15 | +- CUA Driver remains an external prerequisite. The status surface reports its |
| 16 | + version, daemon state, Accessibility permission, and Screen Recording |
| 17 | + permission. Agent native actions are limited to the reviewed allowlist. |
| 18 | +- Origin and application grants are session-scoped by default. Only an explicit |
| 19 | + “Always allow” persists; individual grants can be revoked in Settings. |
| 20 | +- Stop closes the browser/CUA session, aborts active work, and clears session |
| 21 | + grants. A crashed sidecar reaps its owned Chromium process, restarts, restores |
| 22 | + tab URLs and the active tab, then resumes screencasting. |
| 23 | + |
| 24 | +The PoC intentionally excludes file upload, automatic download saving, browser |
| 25 | +extensions, existing Chrome profiles, force-quitting native apps, clipboard |
| 26 | +reading, file transfer, screen recording, and lock-screen control. |
| 27 | + |
| 28 | +## Automated evidence |
| 29 | + |
| 30 | +The following passed on 2026-08-21: |
| 31 | + |
| 32 | +- `npm run verify`: dependency audit, TypeScript, Rust formatting/clippy/tests, |
| 33 | + all server and client tests, lint, identity checks, and production builds. |
| 34 | +- `npm run test:e2e:gjc`: seven driver/wire/browser integration scenarios. |
| 35 | +- `npm run test:e2e:browser`: real Chrome-for-Testing actions, popup and tab |
| 36 | + state, navigation, dialogs, screencast, and interruption of a non-settling |
| 37 | + page script. |
| 38 | +- Fake sidecar recovery integration: restart, orphan-browser reap, URL restore, |
| 39 | + active-tab restore, and screencast resubscription. |
| 40 | +- Fake CUA and HTTP route integration: computer call, persistent grant creation, |
| 41 | + individual revoke, and the public `/api/browser/:sessionId` routes. |
| 42 | +- `npm run smoke:packaged-server -- --tauri-app <app>` and strict `codesign` |
| 43 | + verification against the generated Tauri app bundle. |
| 44 | + |
| 45 | +## Manual packaged-app evidence |
| 46 | + |
| 47 | +The generated app at |
| 48 | +`src-tauri/target/aarch64-apple-darwin/release/bundle/macos/Gajae Code App.app` |
| 49 | +passed these checks: |
| 50 | + |
| 51 | +- Opened `http://100.78.133.28:8080/` in the Workspace Browser panel and showed |
| 52 | + the live todo-list Chromium frame. |
| 53 | +- Killed only the owned browser sidecar. The app reaped the orphaned Chromium, |
| 54 | + started a new sidecar and Chromium process, restored the same URL and tab, and |
| 55 | + resumed the live frame without restarting the desktop app. |
| 56 | +- Ran a Sol session using `computer.list_apps`; CUA Driver 0.21.0 returned that |
| 57 | + TextEdit was running and the app remained stable. |
| 58 | +- Requested a previously unapproved `https://example.org` origin, selected |
| 59 | + **Deny**, and observed a failed-closed tool result while the shared browser |
| 60 | + stayed on the existing todo page. |
| 61 | +- Started `browser.run` with a promise that never settles, pressed Stop, and |
| 62 | + observed cancellation and browser-session cleanup in 733 ms. |
| 63 | + |
| 64 | +macOS Accessibility and Screen Recording were already granted for this test. |
| 65 | +They were inspected but not revoked because changing OS privacy permissions is |
| 66 | +outside normal app QA. Denied app-level origin access exercises the app's |
| 67 | +fail-closed approval path without modifying system security settings. |
| 68 | + |
| 69 | +## Upstream SDK dependency |
| 70 | + |
| 71 | +`@gajae-code/coding-agent@0.14.2` and its upstream `main` branch do not yet |
| 72 | +provide an external backend interface for the reserved `browser` and `computer` |
| 73 | +tools. The app therefore still supplies these two tools through the SDK's |
| 74 | +`customTools` option. The requested architecture—inject at built-in tool |
| 75 | +materialization time without a same-name custom-tool overwrite—requires an |
| 76 | +upstream release. It is tracked in |
| 77 | +[gajae-code issue #4809](https://github.com/Yeachan-Heo/gajae-code/issues/4809). |
| 78 | + |
| 79 | +After upstream publishes that API, replace `customTools` in |
| 80 | +`server/gjc-bun-sdk-adapter.ts`, update `@gajae-code/coding-agent`, and rerun the |
| 81 | +same gates and packaged-app scenarios above. No direct `node_modules` patch is |
| 82 | +permitted. |
0 commit comments