Repository navigation
feat(browser): browser-recording/v1 records one context at a time, with its video, log and network.har (M8.22) - #674
Conversation
…th its video, log and network.har (M8.22) A recording is of a lease or the default context: a video of the tab its agent is on, screencast by the browser's own connection and captured while hidden, encoded by computer-recording/v1's recording class (now Video, taking a stream of frames); the context's log lines, a scoped connection's actions now naming its lease; the browser's whole network log as HAR, marked browser-wide; opt-in frames; and the contexts an agent makes over an address scoped to it, recorded with it. A lease's recording ends with the lease. start_browser_recording takes context, fps and network, frames now off by default; the end fails the run when any part is missing. chromium installs av and Pillow through its own requirements. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
…which a release pins Each shipped env's requirements file holds one protocol line for the release to pin; chromium's new one had none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…at work on a tab Playwright sends every page it attaches to its scripts, bindings and emulation, which the log counts as acting, so the default context's video jumped to its blank start tab for a frame as an agent connected. The video now moves for input, navigation, a tab brought to the front, a dialog or file chooser answered and MCP tool calls; frames still follow every acting entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A frame is of the tab its context's agent last acted on, apart from the tab the video follows. - A video that stops at its limit or after failing ends its recording, and the end step fails it as stopped early. - Lines the network log couldn't read are counted, and fail the end. - A child's manifest that didn't upload is what its parent says is missing of it. - A tab switch drops the old tab's frame and asks the new tab for one at once; a late screencast frame of the tab left is ignored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…shows the tab's last that did A child ended by its context's end and by its parent's at once ran its end twice; an end while one is under way now waits for it. A screencast frame that doesn't decode shows the followed tab's last good frame rather than a blank one. The end-to-end test allows the blank frame a tab switch shows until the new tab's first frame, never another context's colour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…one, and an empty one is no failure - network defaults to on only where the browser keeps a log, as a browser alone does and one in a desktop computer doesn't, so a recording on the defaults starts there; asking for it where there's none still refuses. - A network log with no entries no longer fails the end: an agent may load nothing. One that's missing, unreadable or didn't upload still does. - A recording's objects may be as big as the store's single upload, up to 5 GiB, as a long run's network.har can be. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…twork log's last_seq reads after Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What and why
M8.22 (FD-4970): one browser recording per context.
Since M8.15 and M8.16 each agent can have a context of its own, but
browser-recording/v1recorded the whole browser: frames of whichever tab an agent last acted in, any context, and the log, with no video and no HAR. The only video was the page driver'scomputer-recording/v1, the page tab across contexts. Now a recording is of one context, a lease's or the default one's: a video of the tab its agent is on, its own log, the browser's network log as HAR, opt-in frames, and the contexts its agents make. Two leases recorded at once each show only their own.Design note: M8.22: One browser recording per context, decisions 1a to 5a, Nov 13.
What changes
start_browser_recording {name, context?, fps?, network?, frames?}records the leasecontextnames, else the default context.fpsis 10 by default, 15 at most.networkis on by default where the browser keeps a log, as a browser alone does and one in a desktop computer doesn't; asking for it where there's none refuses.framesis now off by default, as the design doc said (no stored prod task used the step).to_dictwritescontext,fpsandnetworkonly when set, so existing tasks get no new version.computer-recording/v1's recording class, nowVideo, which takes a stream of frames instead of the driver. Computers behave as before.video.followedin the manifest says which tab showed when, and how.context, so a browser-level command lands in the right recording.network.har, start-tab loads included, marked browser-wide, with the lines written during the recording and the leases open meanwhile.contexts/<label>/until its context or the parent ends.context_ended.avand Pillow through its ownrequirements.txt: a computer app getsagentenv-framework-protocol[app], which has neither. A browser app without them refuses a start.computer-recording/v1is unchanged (decision 5). The design doc's line now says itsdisplayis the page tab.Decided while building, for your review
The design note lists 13, in its last section. The ones worth a look:
avand Pillow come from chromium's own requirements, not theappextra.contextfield.How it was tested
Unit:
test_browser_recording.py(26), on a realBrowserControlandContextsover a fake pipe that paints each tab its own colour. Every video is encoded, then decoded with PyAV, and each frame's colour checked.during; refusals with no log, an unleased context, a badfpsor no encoder.context,fpsandnetworkonly when set; the grant'smax_objectsfrom the card; registration of video, HAR and children; the end failing for each missing part; an older browser refused before a start; the round trip writing nothing new for an existing step.Integration, local Docker on an agent-environments-admin c8i.4xlarge (amd64, KVM), with real Playwright and Puppeteer:
A new test records buyer, seller and the default context at once while each one's agent acts through its scoped address.
followedis red, orange, red. The context seller's agent made is recorded undercontexts/agent-bob-1/in its colour.context_ended.Inside a desktop computer, a browser recording ran beside the driver's
computer-recording/v1, each with its video.Regressions, all passing:
browser_computer_test.py, M8.23's recording tests among them, now with videobrowser_multi_env_test.pyandbrowser_gateway_test.pywebsite_browser_test.pychromium_app_test.pyChaos, on the same VM, not committed:
arm64, on an agent-environments-admin m7g.4xlarge: the unit tests (42), the desktop test, the browser recording, lease and scoped-address tests including the new one (7), and the three chaos scenarios (304 to 314 frames each with six leases at once) all passed.
CI, first run: everything passed but
test_release_protocol_pins, which wants a protocol line in each shipped requirements file for the release to pin. Chromium's now namesagentenv-framework-protocol[app], and the new end-to-end test passed again with it.CI, second run: the new end-to-end test caught the follow bug in item 6 above on the runner. Fixed; the end-to-end test and M8.23's recording tests passed again on the VM.
Review fixes (1257019), from your review: the
networkdefault above, an empty HAR no failure, the 5 GiB object cap. On a fresh VM: the unit tests (66), the desktop test on the defaults, the end-to-end test and M8.23's recording tests passed. Follow-ups filed: FD-5846 (real providers and small sandboxes), FD-5847 (the unexplained blank frame), FD-5848 (ops on a lease in the default log), FD-5849 (JavaScript-only agents and the video), FD-5850 (children past the cap), FD-5851 (image size and HAR memory).Greptile, round 1: 4 P1 and 2 P2, all fixed in 77ae37b with tests: frames of the tab acted on, a stopped video ending its recording and failing the end, unreadable HAR lines counted, a child's manifest upload in what's missing, the tab switch above, and a recording ended once. CI then saw one blank frame in buyer's video, which the end-to-end test now allows at a switch (at most 3, never another context's colour); three VM runs in a row passed with at most one.
🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; the numbered finding is fixed and no new actionable issues remain.Summary
The PR adds per-context browser recordings with video, filtered action logs, browser-wide HAR files, optional frames, and child recordings.
Reviews (7) · Last reviewed commit: "refactor(browser): name the line number ..." · Reviewed by Greptile