chore(sandbox): promote deterministic browser snapshot - #251
Merged
Conversation
Point production reconciliation at the immutable snapshot built, scanned, smoke-tested, published, and verified from c40cc4b.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
9 tasks
iamjr15
added a commit
that referenced
this pull request
Aug 12, 2026
## Summary - Bind the fresh accessibility tree and XPath map after every successful deterministic browser action. - Allow required multi-step checks to chain directly from post-action refs without another observation. - Remove unused Stagehand action payloads and clear bound refs whenever the browser runtime is discarded. ## Root Cause The driver returned a post-action tree but cleared its server-held ref map. A subsequent action selected a ref from that returned tree and received a stale-state rejection, leading the agent to observe or reopen the page repeatedly. ## Architecture `browser_observe` and successful `browser_act` now produce the same complete state boundary: bounded tree for the model plus the matching XPath map retained only inside the sandbox driver. Consuming a ref invalidates its prior boundary; success atomically replaces it with the post-action boundary. ## Decisions Made | Decision | Choice | Alternative | Reasoning | |---|---|---|---| | Multi-step state | Bind post-action tree and map atomically | Require observe after every action | Makes the returned tree truthful and removes redundant inference/round trips. | | Action output | Return action identity and bounded state only | Echo Stagehand result | The raw result is unused and adds token/serialization cost. | | Runtime discard | Clear bound observation | Preserve it | Refs cannot outlive the Chromium runtime that created them. | ## Production Reproduction - Ordinary prompt: build a grocery list and verify add, complete, and delete. - Fresh production run entered Working quickly, then repeated observe/act/open for more than six minutes because chained refs were rejected. - Reproduction chat: https://trycheatcode.com/chats/019ff5c6-a3c7-7e77-a513-176a478282b3 ## Verification - [x] `pnpm lint` - [x] `pnpm typecheck` - [x] `pnpm turbo build --force` - [x] `pnpm deadcode` - [x] `pnpm architecture:check` - [x] `pnpm turbo skills:build` - [x] `node --check infra/containers/sandbox/browser-driver/server.js` - [ ] Build, scan, publish, and promote a new immutable Daytona snapshot - [ ] Repeat ordinary-user web and mobile flows on production ## Related - Deterministic browser tooling: #250 - Previous snapshot promotion: #251
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.
Summary
Architecture
The Worker remains the reviewed source of truth for the snapshot identifier. Existing project sandboxes reconcile through the normal lifecycle path; no provider state is mutated out of band.
Decisions Made
Verification
pnpm architecture:checkRelated