Skip to content

chore(sandbox): promote deterministic browser snapshot - #251

Merged
iamjr15 merged 1 commit into
mainfrom
chore/promote-deterministic-browser-snapshot
Aug 12, 2026
Merged

chore(sandbox): promote deterministic browser snapshot#251
iamjr15 merged 1 commit into
mainfrom
chore/promote-deterministic-browser-snapshot

Conversation

@iamjr15

@iamjr15 iamjr15 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Promote the immutable Daytona snapshot produced from merged browser tooling commit c40cc4b.
  • Route production sandbox reconciliation to the image that passed the build, Trivy scan, runtime smoke test, publication, and active-state verification.

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

Decision Choice Alternative Reasoning
Promotion path Versioned wrangler configuration Direct provider mutation Keeps deployment reproducible and reviewable.
Snapshot cheatcode-sandbox-viewer-bundle-c40cc4bf98ad-31591245281 Reuse prior image This exact artifact contains the deterministic browser observe/act implementation.

Verification

  • Build Sandbox Snapshot workflow 31591245281 passed
  • Candidate image scan passed
  • Candidate runtime smoke test passed
  • Published snapshot verified active with zero provider retries
  • pnpm architecture:check
  • Deploy Cloudflare Workers after merge
  • Exercise ordinary-user web, mobile, and non-app production flows

Related

Point production reconciliation at the immutable snapshot built, scanned, smoke-tested,
published, and verified from c40cc4b.
@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
cheatcode Skipped Skipped Aug 12, 2026 11:33am

@iamjr15
iamjr15 merged commit 2e44825 into main Aug 12, 2026
6 checks passed
@iamjr15
iamjr15 deleted the chore/promote-deterministic-browser-snapshot branch August 12, 2026 11:35
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
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