Skip to content

fix(browser): preserve locale, timezone, and device overrides - #119695

Merged
steipete merged 3 commits into
mainfrom
codex/autoqa-browser-device-transitions-20260805
Aug 5, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/autoqa-browser-device-transitions-20260805

Conversation

@steipete

@steipete steipete commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where openclaw browser set locale, set timezone, and set device could report success but lose their direct Chrome emulation state immediately. Device changes preserved only the Playwright-owned viewport; user agent, DPR, physical screen, orientation, mobile mode, and touch state reverted when OpenClaw detached its temporary CDP session. Switching from a mobile preset to desktop also never explicitly disabled touch, and overlapping device commands could interleave fields from different presets.

Why This Change Was Made

Persistent page emulation now has one lifecycle owner. Locale, timezone, and device commands reuse a retained page-scoped CDP session that is detached when the page closes. Device presets run through one per-page atomic queue, explicitly replacing every descriptor field; a request cancelled before admission is skipped, while an admitted descriptor completes as one transition.

This mirrors Playwright 1.62's Chromium device-context behavior and keeps ordinary one-shot CDP reads/mutations on their existing temporary-session helper.

User Impact

Browser locale, timezone, and device overrides now remain active for the controlled page. Switching from iPhone 14 to Desktop Chrome replaces viewport, user agent, DPR, physical screen, orientation, mobile mode, and touch state without mixed or stale values.

Release-note context: fixes browser locale, timezone, and device emulation overrides that reverted or mixed state after successful CLI commands.

Evidence

Exact head: 0b2adead84f90a7089e4bda2b747f75c32070092.

Production delta is +144/-53 (net +91) for the retained emulation-session lifecycle and atomic device-transition boundary. Tests and packaged E2E are +410/-0. No config, protocol, storage schema, dependency, or permission surface changes.

Docs remain accurate: the existing CLI pages already document locale, timezone, and Playwright device presets. OpenClaw changelog generation is release-owned.

@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Aug 5, 2026
@steipete steipete self-assigned this Aug 5, 2026
@steipete
steipete marked this pull request as ready for review August 5, 2026 18:00
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts docker Docker and sandbox tooling labels Aug 5, 2026
@steipete steipete changed the title fix(browser): prevent mixed state when switching devices fix(browser): preserve locale, timezone, and device overrides Aug 5, 2026
@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready proof for 0b2adead84f90a7089e4bda2b747f75c32070092.

  • Root cause: locale, timezone, and device commands applied Chrome Emulation.* overrides through a temporary page CDP session. Detaching that session immediately discarded every direct override; only Playwright's separate viewport update survived. Device replacement also omitted false touch state and allowed descriptor commands to interleave.
  • Architectural owner: the Playwright page lifecycle. One retained page-scoped emulation session now serves locale/timezone/device and detaches on page close; one settled per-page tail makes device descriptors atomic and skips cancelled queued requests.
  • Removed paths: device commands no longer use the one-shot CDP helper, no provider/browser-specific retry or compatibility path was added, and the queue stays inside the page emulation state.
  • Production delta: +144/-53 (net +91). Tests and packaged E2E: +410/-0.
  • Baseline source proof: 4/4 focused cases failed on current main.
  • Final focused proof: 27/27 assertions passed across session reuse/cleanup, device replacement/serialization/cancellation, route signal propagation, CDP helpers, leases, and packaged-scenario contracts.
  • Packaged real-browser baseline: Testbox tbx_01kz9hjzdws88bw65pq62pmg9g, https://github.com/openclaw/openclaw/actions/runs/31033035253, observed only viewport change; DPR/screen/touch/orientation reverted.
  • Packaged real-browser repair: branch-bound Testbox tbx_01kz9j57v8cx2axgpg90nq699r, https://github.com/openclaw/openclaw/actions/runs/31033822493, passed the exact final tree with BROWSER_PLUGIN_PROFILES_PACKAGED_OK. The built CLI retained en-GB and America/New_York, applied the full iPhone 14 descriptor, fully replaced it with Desktop Chrome, and cleaned up the managed browser profile.
  • Exact package/tarball build passed with all 149 public Plugin SDK subpaths.
  • Final worktree-aware changed gate passed every selected extension and tooling lane locally. A branch-bound Testbox changed-gate attempt never reached execution because both targeted and full sync timed out; its lease was stopped. Hosted CI supplies the exact-head Linux authority.
  • Exact-head hosted CI: https://github.com/openclaw/openclaw/actions/runs/31035852715, all jobs and openclaw/ci-gate green.
  • Final full-branch AutoReview: gpt-5.6-sol, xhigh, clean at 0.97 with no accepted/actionable findings.
  • Dependency contract: pinned Playwright 1.62 device descriptors and Chromium emulation source were inspected directly and are linked in the PR body.
  • Docs remain accurate; changelog generation is release-owned. Public model-identifier gate: not applicable.

No proof gap or actionable finding remains.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head d0c6316f7e7aed77c0a82415413e0083e2c52c52, but the PR head is now 0b2adead84f90a7089e4bda2b747f75c32070092. Its old verdict and PR readiness labels are no longer current.

Next step
Run or wait for a fresh ClawSweeper review on the current PR head.

@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

ClawSweeper exact-head status for 0b2adead84f90a7089e4bda2b747f75c32070092:

Proceeding through the repository-native guarded merge without claiming a ClawSweeper approval.

@steipete
steipete merged commit d6233c2 into main Aug 5, 2026
126 of 127 checks passed
@steipete
steipete deleted the codex/autoqa-browser-device-transitions-20260805 branch August 5, 2026 19:29
@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit to VACInc/openclaw that referenced this pull request Aug 5, 2026
…cope

* origin/main: (70 commits)
  fix(clickclack): preserve MIME extension for unnamed uploads (openclaw#119646)
  fix(memory): keep post-ready RPCs responsive (openclaw#119710)
  fix(browser): preserve locale, timezone, and device overrides (openclaw#119695)
  fix(agents): stop messaging dedupe from dropping final replies that quote a short tool send (openclaw#118178)
  test(agents): batch code mode budget proof (openclaw#119699)
  fix(memory): keep gateway RPCs responsive during startup (openclaw#119676)
  improve(ui): trail transient session status beside row actions (openclaw#119560)
  refactor(msteams): consolidate channel action target resolution (openclaw#119632)
  fix: tail context answers the current user message (openclaw#117364)
  fix(whatsapp): exercise descriptor-safe credential persistence (openclaw#119621)
  fix(diagnostics-otel): route OTLP endpoints by signal (openclaw#101655)
  refactor(skills): consolidate workshop transcript and record normalization (openclaw#119643)
  fix(video): harden DashScope task and media lifecycle (openclaw#117303)
  refactor(transcripts): consolidate persistence and export ownership (openclaw#119634)
  fix: preserve ClickClack discussion state contracts (openclaw#118851)
  fix(matrix): retire shared E2EE clients safely (openclaw#119570)
  refactor(cron): unify catch-up persistence and payload encoding (openclaw#119636)
  refactor(ui): centralize composer attachment and capability controls (openclaw#119650)
  refactor(daemon): consolidate managed service lifecycle ownership (openclaw#119647)
  fix(browser): honor explicit navigation timeouts across browser drivers (openclaw#119654)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 6, 2026
…aw#119695)

* fix(browser): make device emulation transitions atomic

* test(browser): verify device presets in packaged profile

* fix(browser): retain page emulation overrides
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker Docker and sandbox tooling maintainer Maintainer-authored PR scripts Repository scripts size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant