Repository navigation
feat(computer): a browser computer's page tools: navigate, history, tabs, dialogs and uploads, and every frame's page - #473
Merged
Conversation
…abs, dialogs and uploads, and every frame's page The protocol gains an optional page group, declared by computer-page/v1: computer_navigate, computer_history, computer_tabs, computer_dialog and computer_upload, served by a driver that implements navigate, history, tabs, dialog, upload and page_state. Every frame such a driver captures carries its page, the active tab's id, URL and title and the dialog or file chooser open on it, and its summary names them; while a dialog is open, the input it blocks is refused dialog_open. browser/v1 gains navigate, history, tabs/list, tabs/open, tabs/activate, tabs/close, dialog/answer, files/choose and page/state, and the page driver serves the group over them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d a frame names the tab its capture came from A dialog the deploy's setting answers at once no longer cuts an input batch short; only one left to the agent does. A page driver's capture now returns the page it shows with it, the captured tab's, which the frame carries rather than a state read after, when another caller may have switched tabs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
An agent on a browser computer can now do what a desktop browser's UI would let it do:
Before this, a pixel agent on #471's page computer couldn't navigate at all, and a dialog froze the page where the agent couldn't see it. This is PR 2 of 3 for the browser as a computer, part of FD-5116. Its five decisions are in the design note, under "PR 2, the page tools".
The page group, in the protocol (decision 1). The protocol reserves
computer_*names, so the tools are an optional operation group, like the pointer group:@navigate,@history,@tabs,@dialog,@uploadand@page_state. A driver that implements all six serves:computer_navigate {url};computer_history {direction: back | forward | reload};computer_tabs {action: list | open | switch | close, tab?, url?}, which answers with the tabs after it;computer_dialog {accept, text?};computer_upload {paths}, files in~/Uploads.The driver also declares
computer-page/v1. Desktop drivers don't change.Every frame names its page (decision 2). Every frame such a driver returns carries an optional
pagefield:tab,urlandtitle;dialog, while one is open, with itstype,messageanddefault_text;file_chooser, while one is open, withmultiple.This covers screenshots, and the input and wait results that return a frame. The page is the one the screenshot was captured on, read in the same call, so a tab switch between the two can't mislabel it. The summary says the same in a line.
General
browser/v1operations behind the tools (decision 3). They're all framework-only, for page drivers and agentenv's own steps alike, and M5.11 reuses the tab operations:navigateandhistory;tabs/list,tabs/open,tabs/activateandtabs/close;dialog/answerandfiles/choose;page/state.Tabs are named by their CDP target ids (decision 4), as the browser record has them.
Input while a dialog is open (decision 5). While a dialog is open on the page, the input it blocks is refused at once with a new
dialog_openerror andapplied: "no". That covers click, drag, scroll, type, key, the pointer and keyboard tools, and also navigate and history. Tabs, the dialog answer and uploads still go through. Screenshots still work: a tab whose page a dialog keeps from painting shows its last capture rather than white.Also in the browser's control connection:
confirm()button would hold the input queue, withcomputer_dialogqueued behind it. A dialog the browser answers itself doesn't stop the input: the rest of it is sent.computer_upload. On a desktop the browser's own chooser still opens.default_text. A dialog answered throughcomputer_dialogis recorded as the agent's answer.ubuntu-24.04-headlessgains~/Uploads.Not in this PR:
Size: 1,012 lines added, about 470 of them tests.
How it was tested
ruff check: clean.pageon screenshots and on input results' frames, with the summary;computer_tabs's tabs;dialog_openuntilcomputer_dialog, withcomputer_tabsstill served;~/Uploads, as many as it allows.invalid_argument.test_a_token_signs_the_clonewas left out, because it waits ongit credential fillon this laptop, on main too.browser_computer_test.py, 4: the new journey has an agent use only its MCP tools on a page computer serving a small test site. It navigates, goes back and forward, answers aconfirm()its click opened (refuseddialog_openbefore it does), opens, switches and closes a tab, and uploads a file from~/Uploadsto a file input. Each step is checked in its screenshot'spage, and the browser's record has the agent's answer and the tab agentenv closed.chromium_app_test.py, 7, andwebsite_browser_test.py, 2, gate 3 among them. The second's methods check now lists the new operations; it failed on both VMs and in CI before that.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no blocking issues remain from this review.Summary
Adds browser navigation, history, tabs, dialog answers, and uploads to page computers. Frames now include the page they show.
~/Uploadsto a page’s open chooser.Reviews (3) · Last reviewed commit: "Expect the browser's new page operations..." · Reviewed by Greptile