Skip to content

Browser act: "action targetId must match request targetId" after gateway restart (2026.6.9) #96176

Description

@don068589

Bug Description

After openclaw gateway restart, ALL browser act operations (evaluate, click, wait, etc.) fail with error:

action targetId must match request targetId

Environment

  • OpenClaw version: 2026.6.9 (c645ec4)
  • OS: Windows 11 (Win32_NT 10.0.26200 x64)
  • Node: v24.14.0
  • Browser: Chromium v144+ (openclaw profile, fresh/managed)

Steps to Reproduce

  1. openclaw gateway restart
  2. Open any page: browser action=open url=https://example.com
  3. Attempt evaluate: browser action=act kind=evaluate fn="1+1" targetId={returnedTargetId}
  4. Result: 403, "action targetId must match request targetId"

Reproducibility

  • 100% reproducible after gateway restart
  • Affects ALL act kinds: evaluate, click, wait, select, fill, drag, etc.
  • Not affected: snapshot, console, open/close/tabs (these still work)
  • Confirmed on fresh tab (open any URL, immediately act → same error)
  • Persists across tab close/reopen cycles

Observed Behavior

Operation Status
snapshot OK
open/close/tabs OK
console Executes but no output returned
act (evaluate/click/wait/...) ALL fail with targetId mismatch

Root Cause Analysis

Traced to dist/routes-D-R1Vq9w.js line ~1288:

if (action.targetId && action.targetId !== tab.targetId) 
    return jsonActError(res, 403, ACT_ERROR_CODES.targetIdMismatch, 
    "action targetId must match request targetId");

The check compares action.targetId (passed by caller) against tab.targetId (CDP internal targetId). After gateway restart, these may diverge — the openPage response returns one targetId (the responseTargetId) but the act handler later resolves tab.targetId to a different CDP-internal identifier.

Workaround

Using subagent + Playwright as fallback for JavaScript-rendered page interaction.

Impact

This breaks the core browser interaction path — critical for workflows that extract data from JavaScript-rendered pages (e.g., video URL extraction from TikTok/Douyin).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions