The browser Loki's agents and Cat Bot already drive (lib/bot-browser) gets a screen: a third view of a session beside Chat and Terminal, beside the conversation on a wide screen and in its place on a phone, with the agent box under it. - CDP screencast while someone watches (6 fps, newest wins), drawn by the existing RobotBrowser, which gains onTap - one wheel: a person's step takes it; every bot step (a look too) answers TAKEN_OVER until hand-back, and the bot's next look carries handedBack - the password/code/card refusal shows as "<bot> needs you" with Take over - caption, pointer on the bot's target, "What happened" timeline (never typed text); native <select> offered as a picker; dialogs said in words - memory: every browser's process tree measured (PSS), closed over 700 MB - doors: /api/browser/live + /input (a signed-in person, own browsers only), /api/browser/step (the account's ck_ token, for Terminal agents), /api/browser/sessions; cloud-builder accounts only; demo denied - /screen redirects to /terminal?view=browser - scripts/test/screen-browser.ts: end to end at 390px and wide Measured on the laptop: one live browser 229–236 MB PSS. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
5.7 KiB
The screen of a bot's browser — watched live, taken over from a phone
Status: SHIPPED (this change). Date: 2026-11-26.
Related: lib/bot-browser.ts (the browser), lib/bot-browser-rules.ts
(its bounds), OrangeCat docs/PARITY.md (Cat Bot ↔ Grok Bot),
docs/handoffs/2026-11-13-cat-bot-parity.md.
What it is
Grok Bot shows its browser while it works, and you can take it over. Cat Bot
and Loki's agents drove a browser of their own (lib/bot-browser, Loki #1697)
that nobody could watch. This change adds the screen to that browser. It does
not add a second browser.
- Where you see it: Terminal → Browser, the third view of a session
next to Chat and Terminal (
TerminalViewSwitch).- On a wide screen it opens as a pane beside the conversation, in the column the Loki rail uses otherwise.
- On a phone it replaces the session view, and the session's own box stays under it, so you tell the agent what to do and watch it happen.
- With no session open, the empty Terminal offers a "Browser" row.
/screenredirects to/terminal?view=browser.
- Which browser it shows: the most recently used one of your account's bot
browsers: your agents' (bot id
loki) or an OrangeCat bot's. When none is open, it waits for one, so a page an agent opens while you watch appears as it loads.
| Piece | Where |
|---|---|
| The browser, a bot's steps and their bounds | lib/bot-browser.ts, lib/bot-browser-rules.ts (unchanged rules) |
| Live frames, a person's steps, the memory cap | lib/bot-browser-live.ts |
| Who drives, person actions, frame shape | lib/bot-browser-live-rules.ts (pure) |
| Watch | GET /api/browser/live (SSE) |
| Take over | POST /api/browser/input |
An agent's step (ck_ token or a person) |
POST /api/browser/step (Cat Bot keeps POST /api/orangecat/browser) |
| What is open | GET /api/browser/sessions |
| The picture | RobotBrowser (the same viewer the site reviews use), now with onTap |
| The pane | components/screen/ScreenPane.tsx |
How it streams
- Frames: CDP
Page.startScreencastsends JPEG frames from the session's page. - When: only while someone watches, at most 6 fps, newest wins. The engine and the SSE route are in the same process, so there is no extra hop.
- Viewer: the picture is drawn by
RobotBrowserat the pane's full width, so all of the page can be seen and tapped. While the bot presses, the pointer glides there and the view leans in on the press, which is how a 1280-wide page stays readable on a phone. - Why not Xvfb + noVNC or WebRTC: no new port, proxy or TURN server, and no X server. One headless Chromium is the cheapest thing that draws a page.
Who drives — learned from the labs
Researched 2026-11-26 against OpenAI's agent / Operator, Claude in Chrome, Project Mariner, Edge Copilot, Comet, Manus, Browserbase, Browser Use, Kernel, Steel, and the Playwright and Chrome DevTools MCPs.
- One wheel, explicit.
- Taking over: a "Take over" button floats on the page, or a tap does it.
- While you drive: the bot is refused, and every step answers
stoppedwithTAKEN_OVER, a look included. It is paused and blind, which is what OpenAI and Manus do. - Handing back: "Hand back" returns the wheel, and the bot's first look
after that carries
handedBack: {from, to}. None of the labs documents telling the agent what changed. It is never told what was typed.
- Passwords, codes and cards are the owner's. The existing bound
(
refusalForField) stops the bot. The pane now shows " needs you" with a Take over button. - You see what it does. A caption on the page and a "What happened" timeline show the last steps. Captions never include typed text.
- What a screencast cannot draw: a native
<select>you open is offered as a picker under the page. A dialog is answered the safe way (an alert is acknowledged, a confirm or prompt declined) and its words are shown. - Not taken, because this is one RAM-tight box:
- WebRTC (Steel, Kernel)
- a VM per session (Kernel)
- video replay
Limits
| Limit | Value | Where |
|---|---|---|
| Browsers per box | 2 (BOT_BROWSER_MAX_SESSIONS) |
engine |
| Idle / max life | 3 min / 20 min | engine sweep |
| Memory | 700 MB PSS for one browser's whole process tree (LOKI_BOT_BROWSER_MEM_MB) |
bot-browser-live reads SystemInfo.getProcessInfo and /proc/*/smaps_rollup every 10 s while any browser is open; over the cap the session closes and the pane says why |
| Network | public addresses only | privateNetworkGuard on the whole context (engine) |
| Frames | 6 fps, only while watched | bot-browser-live |
Measured: one live browser on a small page is about 230 MB PSS (laptop,
scripts/test/screen-browser.ts). The box figure is in the PR.
Who may
- Watch and tap: a signed-in person (
getApiActor().via === "session"). Never a token, nor a session opened with one. Only their own account's browsers. - Open or drive: the account's own
ck_token or the person. Only accounts allowed to build in the cloud (cloudBuilderAllowed), because a browser is a few hundred MB of the box. - Cat Bot: keeps the signed OrangeCat rail.
- Demo account: denied (
DEMO_DENIED_PREFIXES).
What this does NOT protect against
- The bot and the person share one page. What the owner types while in control stays in the page. A field's value is not in the text a bot reads, but the page itself (a profile shown after sign-in) may show it. Sign the bot into a site only if the bot may use that account.
- Cookies persist per bot (the engine's
storageStatefile), as before. - Forged display is not possible from outside the process: frames come from the engine, not from a posted body.