feat(cdp): multi-tenant Phase 1 — BrowserContext isolation primitives - #53
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…_in/clear) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Delegates create_context, close_context, new_target_in, and list_targets_in to context_ops free functions; removes now-unnecessary #[allow(dead_code)] from list_targets_in. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Phase 1 of the multi-tenant tier (design:
docs/superpowers/specs/2026-05-30-multi-tenant-tier-design.md). Adds the Layer-1 isolation backbone so each tenant session can get its own CDPBrowserContext(separate cookies/storage) and its own tab.ras_types::ContextIdnewtype (mirrorsTargetId).BrowserPortgainscreate_context/close_context/new_target_in/list_targets_in(default-error impls keep existing mocks compiling).ras-cdp::context_ops: create/dispose context, open a tab in a context, list targets scoped to a context, per-context download directory, context-scoped cookie clear (chromiumoxide 0.9.1:createBrowserContext/disposeBrowserContext/Target.getTargetsfiltered bybrowserContextId/Storage.clearCookies{browserContextId}/setDownloadBehavior{browserContextId}).ChromiumoxideAdapterimplements the four methods.create_contextdisposes the context on its error path (no leak).Out of scope (later phases): AR-4 page-cache/lock fix, AR-5 egress/SSRF, agent target-binding (AR-3), the context-tagged event producer, and the
ras-sessioncrate.Test Plan
cargo build --workspaceclean;cargo clippy -p ras-cdpclean; pre-commit hooks green.ras-typesContextId roundtrip.#[ignore]+CDP_URL) against headless Chrome 148 — 2 passed:contexts_isolate_cookies: cookie set in ctx A is not visible in ctx B; closing ctx A frees its tab.list_targets_in_is_context_scoped: each context lists only its own tab.CDP_URL=http://127.0.0.1:9222 cargo test -p ras-cdp --test e2e_context_isolation -- --ignoredNotes
chromiumoxide_adapter.rsis now exactly 200 LOC (the cap) — the next phase touching it must split it.🤖 Generated with Claude Code