Skip to content

fix: preserve browser sessions across action failures - #266

Merged
iamjr15 merged 1 commit into
mainfrom
fix/atomic-browser-actions
Aug 12, 2026
Merged

fix: preserve browser sessions across action failures#266
iamjr15 merged 1 commit into
mainfrom
fix/atomic-browser-actions

Conversation

@iamjr15

@iamjr15 iamjr15 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • binds each deterministic browser action to the driver's retained observation in one serialized request
  • removes the separate Worker-to-driver state request that doubled preparation and could race a restart
  • preserves a healthy Chromium session after an ordinary click/fill failure; only security or runtime-integrity failures discard it

Architecture

The sandbox driver now owns the full observation boundary: element ref, exact page URL, XPath, and allowed origin. The Worker sends only the bounded method/ref/value. The driver derives and enforces URL/origin guards immediately before replaying the observed Stagehand action, then records the new tree atomically.

Decisions Made

Decision Choice Reasoning
Security binding owner Sandbox driver The retained observation is authoritative and cannot race a separate state call
Ordinary action failure Keep browser, invalidate refs A click timeout does not prove browser integrity was lost
Security/runtime failure Discard runtime Origin interception or active-page integrity failures require a clean browser

Verification

  • pnpm lint
  • pnpm typecheck
  • pnpm turbo build --force
  • pnpm deadcode
  • pnpm architecture:check
  • pnpm turbo skills:build
  • node --check infra/containers/sandbox/browser-driver/server.js

Production browser QA will follow immutable sandbox snapshot publication and promotion because the driver is image-owned.

Bind browser actions to the driver's retained observation in one request.
Preserve healthy sessions after ordinary action failures. Restart only when
origin or runtime integrity fails.
@iamjr15
iamjr15 merged commit 7d0bc46 into main Aug 12, 2026
4 checks passed
@iamjr15
iamjr15 deleted the fix/atomic-browser-actions branch August 12, 2026 21:47
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