Skip to content

Start ephemeral hosted browsers from saved profiles (KES-736) - #6908

Merged
chelojimenez merged 3 commits into
mainfrom
kes-736-saved-profile-boot
Oct 30, 2026
Merged

chelojimenez merged 3 commits into
mainfrom
kes-736-saved-profile-boot

Conversation

@chelojimenez

@chelojimenez chelojimenez commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Task, spec and plan

User story

As a hosted eval or journey author,
I want the browser to load my client's saved profile,
so that the first observation starts signed in.

Acceptance criteria

  • Delivered archives import in both context modes and are deleted after success or failure.
  • An import failure stops boot with a saved-profile error.
  • Imported ephemeral browsers retain ephemeral options; unseeded launches keep their existing path.
  • Ephemeral profile export stays disabled (501).
  • A web eval launch refused with BROWSER_PROFILE_NOT_DELIVERABLE (backend refactor(HomeTab): drop ensureOrgMetricFresh client effect #2399) answers 400 with the backend's message instead of a 500.
  • A real Chromium test restores cookies and local storage into two independent runs.

What this does

Restores the archive before Chromium launch and reuses one profile-directory launch helper. The session remains ephemeral and never saves back. No mode/schema changes are needed. Both browserd distribution files are regenerated.

Do not merge or release yet: backend #2398 must ship first, and GDPR-85 / #6452 must merge before this change ships. Rebase and regenerate browserd after that dependency lands. This draft does not include or waive that privacy fix.

Documentation

Corrects existing technical tables in local-browser-engine.md and webmcp-inspector.md as requested by KES-736. These describe the implementation; they are not GA or release evidence. Publication scope still requires maintainer review.

Architecture

flowchart LR
  Archive[Delivered archive] -->|import then delete| Directory[Per-run profile directory]
  Directory -->|launchPersistentContext with ephemeral options| Chromium
  Chromium -->|discard at run end| Teardown
Loading

Screenshots and recordings

None: no UI change

Deleted

The persistent-only import guard and swallowed archive-unlink error. The duplicate profile-directory launch path becomes one helper.

Reused

Existing archive importer, singleton-lock handling, contextOptionsFor, context adapter, and persistent-only export wiring.

Production signal

Existing browserd startup failure reporting. Staging must still prove the first observation is signed in on eval and journey surfaces.

Automated decisions

None: no automated decision about users

Verification

  • 2,063 browserd/built-in-tool tests pass; 14 opt-in tests skipped.
  • 71 preparation/script tests pass; one skipped.
  • Opt-in real Chromium saved-profile test passes: cookies/local storage restore and first-run mutations do not reach run 2.
  • Server typecheck passes its ratchet: 106 existing errors against a baseline of 109.
  • slop:check and bundle freshness pass. slop:size: 95 source lines (moved lines counted once).
  • Live hosted staging is unverified: CLI reports not logged in and the environment has no inspector service token.

Checklist

  • I can explain every line of this diff without the agent that wrote it.
  • Under 800 changed lines of hand-written source.
  • No new type escapes, empty catches, swallowed errors or raw server console.
  • Comments describe current behavior.

@chelojimenez

chelojimenez commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Internal preview

Preview URL: https://mcp-inspector-pr-6908.up.railway.app
Deployed commit: 02bb0cd
PR head commit: 4332b58
Backend target: staging fallback.
Health: ✅ Convex reachable
Access is employee-only in non-production environments.

- Map BROWSER_PROFILE_NOT_DELIVERABLE in the launch-refusal table so a
  web eval launch shows the backend's message as a 400 instead of a 500.
- Restore the local engine's Profiles row: local unattended runs still
  start without a profile; only hosted runs restore a saved copy.
- Update the hosted comments that still said ephemeral means no profile.
- Format the PR's new lines, move the hoisted Playwright mock to the top
  of its test file, and regenerate the browserd bundle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chelojimenez
chelojimenez marked this pull request as ready for review October 29, 2026 23:45
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-10-29T23:48:46.172521Z 4332b58 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Regenerated the browserd bundle to resolve the conflict.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Walkthrough

The daemon now prepares saved-profile archives before browser launch. Imported profiles use persistent browser contexts in persistent and ephemeral modes, while unseeded ephemeral runs retain isolated in-memory contexts. The changes add tests for archive preparation and launch selection, an opt-in real-browser test for separate ephemeral runs, and a test that ephemeral profile export returns HTTP 501. The environment resolver maps browser-profile delivery refusals to HTTP 400. Documentation and a changeset describe saved-profile behavior.

Priority: Normal

Merge Risk: Minimal · up to 4332b

No verified code issue blocks this change on the supplied evidence. Confirm the stated backend and privacy release dependencies before shipping.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@chelojimenez
chelojimenez added this pull request to the merge queue Oct 29, 2026
Merged via the queue into main with commit 5a5c537 Oct 30, 2026
41 of 42 checks passed
@chelojimenez
chelojimenez deleted the kes-736-saved-profile-boot branch October 30, 2026 00:03

This branch was successfully deployed

1 active deployment
preview-pr-6908 — 4332b58b Deployed Oct 29, 2026 by chelojimenez via upsert-preview #36180
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.

2 participants