fix(browser): port upstream existing-session readiness and profile targeting [AI-assisted]#104
Merged
Merged
Conversation
(cherry picked from commit beadd4c)
…openclaw#48170) Merged via squash. Prepared head SHA: e490035 Co-authored-by: velvet-shark <126378+velvet-shark@users.noreply.github.com> Co-authored-by: velvet-shark <126378+velvet-shark@users.noreply.github.com> Reviewed-by: @velvet-shark (cherry picked from commit 7deb543)
(cherry picked from commit 72d775e)
- what: restore legacy Chrome MCP timeout call shapes while threading userDataDir through the new existing-session flow and update affected browser tests - why: the upstream port added userDataDir support but broke older timeout-based helper calls and shifted browser test expectations around built-in cloned profiles and attach readiness - risk: low; the change is backward-compatible and covered by targeted browser tests
- what: add the explicit Chrome MCP call-options cast used by the backward-compatible userDataDir/options parser - why: without the cast the merged overload path still works at runtime but trips TypeScript during build - risk: very low; this is a type-only correction with no behavior change
- what: switch new-worktree defaults from .claude/claude/* to .codex/codex/* and update the Telegram worktree README example - why: the helper should generate the same workspace layout and branch prefix we actually use for Codex sessions instead of suggesting the wrong tree by default - risk: low; this only changes helper defaults and docs, not git worktree semantics or runtime behavior
This was referenced Mar 24, 2026
21 tasks
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
mainfork was missing recent upstream browser fixes for existing-session readiness, non-default Chromium profile targeting, and launch behavior.71bd0f2b6d(beadd4c553),49478686c3(7deb543624), and88bf26bf25(72d775e069), then added small follow-up compatibility/type fixes plus switched the worktree helper default from.claudeto.codex.AI-assisted: yes. Built with Codex, with local verification and follow-up fixes for merge compatibility.
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
userDataDirpaths for Brave, Edge, Chromium, or non-default Chrome profiles.about:blanktab.scripts/new-worktree.shnow defaults to.codex/worktrees/<feature>andcodex/<feature>.Security Impact (required)
No)No)No)No)No)Yes, explain risk + mitigation:Repro + Verification
Environment
userDataDirpaths in testsSteps
userDataDir, and launch args into a fresh branch frommain.pnpm build,bash -n scripts/new-worktree.sh, and scoped format checks on touched files.Expected
userDataDir..codexpaths/branches.Actual
pnpm checkstill fails on unrelated pre-existing formatting issues in consumer docs (docs/consumer/openclaw-consumer-*.md).pnpm buildexits 0 but still prints unrelated existing TypeScript errors insrc/agents/pi-embedded-runner/run/attempt.tsaboutskipWaitForIdle.Evidence
Human Verification (required)
pnpm test -- src/browser/chrome.launch-args.test.ts src/browser/chrome-mcp.test.ts src/browser/config.test.ts src/browser/profiles-service.test.ts src/browser/server-context.existing-session.test.ts src/browser/routes/basic.existing-session.test.ts src/browser/server.post-tabs-open-profile-unknown-returns-404.test.ts src/cli/browser-cli-manage.test.ts src/commands/doctor-browser.test.tspnpm buildbash -n scripts/new-worktree.shpnpm exec oxfmt --check src/browser/chrome-mcp.ts src/browser/config.test.ts src/browser/profiles-service.test.ts src/browser/server-context.existing-session.test.ts src/browser/server-context.tab-ops.ts scripts/telegram-e2e/README.mduserDataDiruserprofile expectations remain intactpnpm checkdue unrelated pre-existing doc formatting failurespnpm testsuiteReview Conversations
Compatibility / Migration
Yes)No)No)Failure Recovery (if this breaks)
src/browser/*,src/commands/doctor-browser.ts, andscripts/new-worktree.shfor helper default behavior.Risks and Mitigations
userDataDirsupport could break older callers that passed timeout options in the second argument position.