Skip to content

fix(bot-panel): show a browser bot's browser on a server, not an empty screen - #99

Open
PranitSakhuja wants to merge 1 commit into
DuskBotAI:mainfrom
PranitSakhuja:fix/remote-browser-view
Open

PranitSakhuja wants to merge 1 commit into
DuskBotAI:mainfrom
PranitSakhuja:fix/remote-browser-view

Conversation

@PranitSakhuja

Copy link
Copy Markdown
Contributor

What and why

On a paired server of your own (or dusk cloud), a bot whose computer is its browser showed nothing you could watch. ComputerTab set ownScreen = !local || current === "vm", so any bot off this computer got the inline ComputerPanel. For a browser bot that panel lands in its "no computer" branch, which offers to wake or add a computer, while the bot keeps browsing on the server and its tool lines appear in the chat.

The browser itself already works from the server's page: useLocalBrowser and the stream at /api/bots/<id>/browser use the page's own origin, which is the server running the turn and owning the browser. So the panel only had to pick it.

A bot now leads with its browser on a server when its computer is that browser, the same LocalBrowserSection this computer uses. Every other server bot keeps its screen. On a server the section is followed by the existing move-to-dusk-cloud card instead of this computer's checkout card, so nothing the server's page offered is lost. askFirst stays null off this computer, so the server's browser never asks for Mac permissions.

Fixes #73 for bots set to their browser.

How it was checked

A new case in src/components/BotSettingsDialog.simple.test.ts ("the Computer tab") renders a computer: "browser" bot with the window on a paired server. It asserts the browser section is drawn, with no inline screen, no "Scout's screen" caption, no Mac permission ask, and the move-to-dusk-cloud card after it. It fails on main (no browser section) and passes with the change. The existing cases still pass: a cloud bot on a server leads with its screen, and a Private desktop bot on this computer still shows its screen.

  • pnpm typecheck (app) passes and pnpm lint is clean. vitest run src/components/BotSettingsDialog.simple.test.ts src/components/bot-panel src/components/ComputerPanel passes 342 of 344. The 2 failures are the routines-list cases in BotSettingsDialog.simple.test.ts (schedule wording), and they fail the same way without this change. Checked against dev; the change applies unchanged to main, which this targets.

  • New behaviour has a test

  • No secrets, personal data or local paths in the diff

Notes for reviewers

  • No screenshots: I don't have a paired server to show the real panel. The change is which existing section renders, covered by the test above.
  • Out of scope: a bot on Auto or on a cloud computer that also opens a browser on the server still shows only the server's screen. Showing the live browser above the screen while it's open would need a "only while open" mode for LocalBrowserSection. Happy to follow up if you want that.
  • Bot panel: a bot's commands and browsing under the Computer tab #96 touches the same line in ComputerTab.tsx. If it lands first, the server branch here should get the same steps prop as the local one; the rebase is mechanical.

…y screen

Off this computer the Computer tab always drew the inline screen, which for a bot whose computer is its browser lands on the no-computer card while the bot browses on the server. Lead with the browser section there too, followed by the move to dusk cloud.
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.

Bot browsing on a remote machine can't be watched: the machine's screen takes the browser's place

1 participant