Skip to content

feat: each bot gets its own browser, watched live in the app - #32

Merged
httpsphl merged 4 commits into
mainfrom
feat/bot-browser
Sep 29, 2026
Merged

httpsphl merged 4 commits into
mainfrom
feat/bot-browser

Conversation

@httpsphl

@httpsphl httpsphl commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

What

Bots can now research and use websites in a browser of their own, and the owner watches it live beside the chat (spec section 21).

Daemon (N1)

  • Each bot gets a Microsoft Edge without a window (--headless=new), started on its first browser_* tool, in its own Job Object, with a profile in <home>\browsers\<bot_id>. A small DevTools client follows every tab (popups become the active one), waits for pages to settle, accepts dialogs and sends downloads to the bot's downloads\ folder.
  • A page reader runs in an isolated JS world and turns the page into text, with refs such as [e12 link "Sign in"] for links, buttons and fields.
  • Ten MCP tools: browser_open, browser_look, browser_click, browser_type, browser_select, browser_press, browser_scroll, browser_back, browser_screenshot (an image the model sees) and browser_close.
  • Sites follow the bot's mode. In Manual, Accept edits and Plan, the first visit to each site waits for the owner's OK in the chat, and the OK is remembered per bot in browser_sites. Auto and Bypass browse freely. file: pages open only from the bot's own folders.
  • RPC: browser.list, and browser.watch/browser.unwatch per connection. browser.changed and browser.action go to every app; browser.frame goes only to the connection watching, newest frame wins.
  • Browsers close when idle ([browser] idle_minutes), when their bot or crew pauses, and past max_open. Archiving deletes the profile.

App (N2)

  • A globe button in the bot's header, with a pulsing dot while the bot is browsing, opens the browser panel. It shows the address, the live page, the bot's cursor in its own color gliding to each click, a ring where it clicks, a "Live" badge and a line about what it did. The panel can be widened.
  • Browser lines in the chat get a globe and a "Watch in browser" button. Site requests get their own card.
  • Texts in English, Portuguese and Spanish. FakeBotloft has browsers, and the dev preview shows Scout searching live.

Tests

  • cargo test --workspace (235), clippy -D warnings, fmt, pnpm check (124 tests).
  • crates/botloftd/tests/browser.rs runs against the real Edge (skipped where it is not installed) with a local site: form filling, site allow/deny, files, new tabs, dialogs, live frames, actions and screenshots.

Tested with the real Claude Code (2.1.284, Haiku, Manual mode)

Done with a dev daemon and the app preview (?live):

  1. Ask the bot to open https://example.com, click its link and take a screenshot. The site card appeared; after allowing it, the panel showed the page and the cursor live.
  2. The click led to iana.org. The next tool asked for that site, and a later screenshot did not ask again.
  3. Asked only for the logo's colors in a new screenshot, the bot answered correctly, so the image reaches the model.
  4. Pausing the bot closed its Edge processes. The debug log held only tool names, methods and ids.

Still to try by hand: the panel inside the Tauri window (pnpm tauri dev) rather than the browser preview.

BrowserState, BrowserFrame, BrowserAction and BrowserView for the app
(browser.list, browser.watch, browser.unwatch and their notifications),
the browser_sites table, and chat summaries for the browser tools and the
owner's site request (spec 21.5, 21.7).
The daemon starts a Microsoft Edge without a window per bot on its first
browser_* tool, in a job of its own, with a profile under
<home>\browsers. A small DevTools client follows every tab (popups become
the active one), waits for pages to settle, accepts dialogs and sends
downloads to the bot's folder. A page reader in an isolated world turns
the page into text with refs for links, buttons and fields.

Ten MCP tools let the bot open, read, click, type, choose, press,
scroll, go back, see the screen and close. In Manual, Accept edits and
Plan modes the first visit to each site waits for the owner, and files
open only from the bot's own folders. The app lists browsers, watches
one per connection with latest-wins frames, and hears every action for
the cursor. Idle browsers and those of paused or archived bots close.

Spec: new section 21; tests run against the real Edge when installed.
A globe button in the bot's header opens the browser panel, with a dot
while the bot is browsing. The panel shows the address, the page as the
bot sees it (frames from browser.watch), the bot's cursor gliding to
each point it acts on, a ring where it clicks and a line about what it
did. Closed browsers keep their last page, faded; one that could not
start says why. The panel can take all the room the chat can spare.

Browser tool lines in the chat get the globe and a button to watch, and
a bot asking to use a site gets its own card. The store follows
browser.list and browser.changed; FakeBotloft fakes browsers, and the
dev preview has Scout searching live. Texts in English, Portuguese and
Spanish.
A Manual bot on Haiku asked for each new site, opened and clicked, and
answered from the screenshot image. Also records why Edge runs with
--disable-extensions and why a new tab's setup goes out at once.
@httpsphl
httpsphl enabled auto-merge September 29, 2026 15:55
@httpsphl
httpsphl merged commit f264431 into main Sep 29, 2026
3 checks passed
@httpsphl httpsphl mentioned this pull request Sep 30, 2026
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