Skip to content

refactor(browser): unify browser mutation routes - #129303

Merged
steipete merged 1 commit into
mainfrom
codex/cleanup20k-browser-storage-runtime-owner-20260825
Aug 25, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/cleanup20k-browser-storage-runtime-owner-20260825

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The shipped Browser storage/device HTTP owner duplicated common guarded mutation scaffolding across its cookies, storage, credentials, emulation, and related action routes. Repeated handlers obscured the intentionally different security policies for current-tab reads versus explicit mutations.

Why This Change Was Made

The existing private Browser route owner now shares one canonical mutation-registration flow while preserving all 15 HTTP route identities, features, leases, abort signals, validation, credentials redaction, cookie result shapes, and separate SSRF guard policies. The existing route test gains direct security and lifecycle coverage instead of replacing real behavior with mocks.

User Impact

Authenticated browser storage and device commands behave exactly as before. Current-tab cookie/storage reads continue rejecting private navigation, while intentionally allowed mutations keep their original policy. Credential secrets are never echoed, and cancellation does not destroy the selected browser tab.

Evidence

  • A real isolated Chrome 151 session and authenticated Browser/CDP bridge executed 26 actual HTTP requests across all 13 mutation families and both read routes.
  • Live strict localhost policy returned HTTP 400 for both guarded GET cookie/storage reads while the intentionally distinct mutation path returned HTTP 200; unauthorized requests returned HTTP 401.
  • The same real browser run proved credentials are not echoed, cookie batches report exactly two added items, and a genuine AbortError cancellation preserves the active tab.
  • Seven actual route, browser, authorization, and lifecycle suites passed all 103 tests; the max-lines ratchet, targeted lint, formatting, and git diff --check passed.
  • Three independent source/security/real-behavior reviews and full structured precommit review completed without findings.
  • Genuine shipped Browser production delta: 101 added, 174 deleted, net -73. Meaningful existing route tests changed +83/-34, net +49, and are excluded from production accounting.
  • No public SDK, configuration, protocol, SQLite schema, authentication, or documented Browser command contract changes.

@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review August 25, 2026 12:07
@steipete
steipete merged commit 3506a55 into main Aug 25, 2026
170 checks passed
@steipete
steipete deleted the codex/cleanup20k-browser-storage-runtime-owner-20260825 branch August 25, 2026 12:28
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant