Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

docs(AGENTS.md): rewrite web UI debugging instructions for attach-mode workflow

Steven Enamakeldbf6453358fd
diff --git a/AGENTS.md b/AGENTS.md
index 65dfefb578..3dfd0c1df1 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -82,22 +82,29 @@ Debugging the web UI in a real browser (Chrome DevTools MCP): the desktop
window is Wry (WKWebView / WebView2 / WebKitGTK), which does not support CDP, so no
DevTools client can attach to it. Run the same SPA in Chrome instead:
-- `pnpm dev:app:web --no-browser` (`scripts/run-dev-web.sh`) builds and starts
- `openhuman-core serve` with a generated bearer, starts Vite on `:1420`, and
- prints `http://localhost:1420/__dev-connect`. Open that URL with the
- chrome-devtools MCP (`new_page` / `navigate_page`). The dev-server-only route
- seeds the core URL and bearer into `localStorage`, so you never paste
- `OPENHUMAN_CORE_TOKEN` yourself.
-- Sign-in takes one click on a provider button. The browser build passes
- `<origin>/__dev-auth` as the backend `redirectUri` (http loopback URIs are
- accepted), and that route redirects the returned token to the `#/auth`
- callback. The session lives in the core workspace, so later runs start
- signed in. Both routes are in `devConnectPlugin` (`app/vite.config.ts`) and
- answer only loopback callers.
+- **Use the desktop app's session:** `pnpm dev:app:web:attach -- --no-browser`
+ finds the running desktop core, starts Vite, and prints
+ `http://127.0.0.1:<core>/dev/connect?app=http://localhost:<vite>`. Open that
+ URL with the chrome-devtools MCP (`new_page` / `navigate_page`). The core's
+ dev-only `GET /dev/connect` (`crates/openhuman-core/src/core/dev_connect.rs`)
+ redirects to Vite's `/__dev-connect` page with the RPC URL and bearer in the
+ URL fragment. That page seeds them into `localStorage`, so the browser runs on
+ the desktop core with its signed-in user, and nothing is pasted. The route
+ exists in debug builds, or in a release build with `OPENHUMAN_DEV_CONNECT=1`.
+ It accepts only a loopback `app` origin and `Host`, and refuses cross-site
+ navigations.
+- **Fresh core instead:** `pnpm dev:app:web --no-browser` builds and starts its
+ own `openhuman-core serve` with a generated bearer and prints
+ `http://localhost:<vite>/__dev-connect`. Sign-in takes one click on a provider:
+ the browser build passes `<origin>/__dev-auth` as the backend `redirectUri`,
+ and the session persists in that core's workspace.
+- Busy ports are fine. Vite and the standalone core move to the next free port,
+ and the printed URL always uses the real one.
- Inspect with `take_snapshot`, `list_console_messages`,
`list_network_requests` (check the `/rpc` calls), `evaluate_script`, and
`take_screenshot`.
-- Env settings: `OPENHUMAN_DEV_PORT`, `OPENHUMAN_CORE_PORT`, `OPENHUMAN_CORE_TOKEN`,
+- Env settings: `OPENHUMAN_DEV_PORT`, `OPENHUMAN_CORE_PORT` (in attach mode, the
+ desktop core's port; the default scans 7788-7808), `OPENHUMAN_CORE_TOKEN`, and
`OPENHUMAN_WORKSPACE` (point it at a scratch dir for a clean profile).
Long CI build or test commands must run through