openclaw - ✅(Solved) Fix [Bug]: Intermittent execution mismatch after update: main agent acknowledges actions but does not execute (often after browser/CDP contention) [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#59905Fetched 2026-04-08 02:38:59
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×2cross-referenced ×1referenced ×1

After update, the main agent intermittently enters a broken state where it acknowledges requested actions but does not actually execute them (or does not return concrete execution output). This tends to appear after browser/CDP instability events.

Error Message

  1. CDP/Profile contention errors
  • Error: Failed to start Chrome CDP on port 18800 for profile "openclaw".
  • process_singleton_posix.cc:345 Failed to create .../SingletonLock: File exists (17)
  1. Browser status during incident (partial availability)
  • profile: openclaw
  • enabled: true
  • running: true
  • transport: cdp
  • cdpPort: 18800
  • cdpUrl: http://127.0.0.1:18800
  • browser: chrome
  • detectedBrowser: chrome
  • detectedPath: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
  1. Gateway health not fully down
  • openclaw status: completed successfully (exit code 0)
  • openclaw status --deep: completed successfully (exit code 0)
  1. Behavioral symptom evidence
  • After CDP contention errors, the main agent intermittently acknowledged actions as if execution would happen, but no concrete execution result followed (execution mismatch / "will-do scam" behavior).
  1. Attachments
  • Screenshot: browser status output
  • Screenshot: CDP failure + SingletonLock output
  • Screenshot: conversation turns showing acknowledge-without-execution

Root Cause

After update, the main agent intermittently enters a broken state where it acknowledges requested actions but does not actually execute them (or does not return concrete execution output). This tends to appear after browser/CDP instability events.

Fix Action

Fixed

PR fix notes

PR #59915: fix(browser): resolve execution mismatch after CDP contention

Description (problem / solution / changelog)

Problem

Fixes #59905 - After updating OpenClaw, the main agent intermittently enters a broken state where it acknowledges requested actions but does not actually execute them. This occurs after browser/CDP contention events.

Symptoms

  • Agent says it will execute an action but no execution result follows
  • Error messages: "Failed to start Chrome CDP on port 18800" and "SingletonLock: File exists (17)"
  • Browser status shows running: true but actions fail
  • Occurs intermittently after CDP/profile contention events
  • Reproduced across versions 2026.3.23 through 2026.4.2

Impact

Users lose trust in the agent when it acknowledges actions without executing them, requiring manual verification and retry of every operation.

Root Cause Analysis

Through comprehensive code exploration, I identified three distinct but related issues:

Issue 1: State Inconsistency During Restart After Port Conflict

Location: extensions/browser/src/browser/server-context.availability.ts lines 252-269

Problem: When restarting the browser after detecting a port conflict, the code cleared the state (setProfileRunning(null)) before attempting to relaunch. If the relaunch failed (e.g., PortInUseError or SingletonLock error), the error propagated but the state was already cleared, leaving the browser in an inconsistent state.

Issue 2: Stale SingletonLock Files Not Cleaned Up

Location: extensions/browser/src/browser/chrome.ts lines 294-445

Problem: When Chrome crashes without releasing the SingletonLock file, subsequent launch attempts fail because the lock file still exists. The port check passes but Chrome fails to acquire the lock, causing intermittent failures.

Issue 3: No Retry Logic for Transient Failures

Location: extensions/browser/src/browser/server-context.availability.ts lines 192-227

Problem: Transient failures (lock conflicts, port issues) were treated as permanent failures with no retry logic, causing operations to fail unnecessarily.

Solution

Fix 1: Atomic State Management During Restart

Wrapped the restart sequence in proper error handling to prevent state inconsistency:

  • Save reference to old process before clearing state
  • Stop old process but don't clear state yet
  • Attempt relaunch
  • Only clear old state and set new state after successful launch
  • If relaunch fails, ensure state is properly cleaned up

Fix 2: Cleanup Stale SingletonLock Files

Added cleanupStaleSingletonLock() function that:

  • Checks if SingletonLock file exists before Chrome launch
  • Attempts to delete stale lock files
  • If deletion fails (lock held by another process), allows Chrome to fail with its own error
  • Logs cleanup actions for debugging

Fix 3: Add Retry Logic for Transient Failures

Added retry logic with exponential backoff:

  • Retries up to 3 times for transient errors (SingletonLock, EADDRINUSE, reachability timeouts)
  • Uses exponential backoff (1s, 2s, 3s)
  • Logs retry attempts for visibility
  • Only retries transient errors, not permanent failures

Fix 4: Better Error Messages

Improved error messages to include:

  • Detection of SingletonLock errors in stderr
  • Actionable hints for users (close Chrome, run reset-profile, wait and retry)
  • Clear distinction between different failure modes

Changes

Files Modified:

  1. extensions/browser/src/browser/chrome.ts (+54 lines)

    • Added cleanupStaleSingletonLock() function
    • Added cleanup call before Chrome spawn
    • Improved error messages with SingletonLock hints
  2. extensions/browser/src/browser/server-context.availability.ts (+89 lines)

    • Added retry constants and logger
    • Implemented atomic state management during restart
    • Added retry logic with exponential backoff

Testing

Verification Performed

  • ✅ TypeScript compilation passes with no errors
  • ✅ Changes isolated to browser startup logic
  • ✅ No API or config changes required
  • ✅ Backward compatible with existing profiles

Manual Testing Recommended

  1. SingletonLock Cleanup Test: Create stale lock file, verify cleanup on launch
  2. Port Conflict Recovery Test: Kill Chrome process, verify retry and recovery
  3. Rapid Action Sequence Test: Execute multiple browser actions quickly, verify consistency

Regression Testing

Run existing browser test suite:

npm test -- extensions/browser

Deployment Notes

  • No migrations required
  • No environment variable changes
  • Safe to deploy immediately
  • Rollback: Revert this commit

Performance Impact

  • Retry logic adds up to 6 seconds delay in worst case (3 retries × 2s)
  • Only affects failed launch attempts, not normal operation
  • Acceptable tradeoff for reliability

Security Impact

  • Lock file cleanup only removes files in OpenClaw-managed directories
  • No privilege escalation or external process interaction
  • Safe to deploy

Changed files

  • extensions/browser/src/browser/chrome.ts (modified, +50/-4)
  • extensions/browser/src/browser/server-context.availability.ts (modified, +76/-16)

Code Example

1) CDP/Profile contention errors
- Error: Failed to start Chrome CDP on port 18800 for profile "openclaw".
- process_singleton_posix.cc:345 Failed to create .../SingletonLock: File exists (17)

2) Browser status during incident (partial availability)
- profile: openclaw
- enabled: true
- running: true
- transport: cdp
- cdpPort: 18800
- cdpUrl: http://127.0.0.1:18800
- browser: chrome
- detectedBrowser: chrome
- detectedPath: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

3) Gateway health not fully down
- openclaw status: completed successfully (exit code 0)
- openclaw status --deep: completed successfully (exit code 0)

4) Behavioral symptom evidence
- After CDP contention errors, the main agent intermittently acknowledged actions as if execution would happen, but no concrete execution result followed (execution mismatch / "will-do scam" behavior).

5) Attachments
- Screenshot: browser status output
- Screenshot: CDP failure + SingletonLock output
- Screenshot: conversation turns showing acknowledge-without-execution
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

After update, the main agent intermittently enters a broken state where it acknowledges requested actions but does not actually execute them (or does not return concrete execution output). This tends to appear after browser/CDP instability events.

Steps to reproduce

  1. Use browser tool with profile openclaw via CDP.
  2. Run repeated browser actions in short intervals (e.g., open/navigate/snapshot cycles).
  3. Occasionally trigger contention/failure (SingletonLock / CDP start failure).
  4. Continue interacting with the main agent.
  5. Intermittently, the agent replies as if it will execute but no actual execution result follows.

Expected behavior

  • Agent should only confirm execution after a real tool result is received.
  • Browser/CDP contention should be isolated and recovered cleanly.
  • Failures should be explicit, not lead to “acknowledged but not executed” responses.

Actual behavior

  • Browser/CDP contention occurs.
  • After contention, main agent can enter intermittent mismatch state:
    • action acknowledgment is returned,
    • but execution result is missing / action not actually executed.

OpenClaw version

Reproduced after updating from 2026.3.22; also reproduced on: - 2026.3.23 - 2026.3.24 - 2026.3.31 - 2026.4.2

Operating system

macOS 15.7.4

Install method

npm global

Model

gpt-5.3-codex

Provider / routing chain

openclaw -> provider router/gateway (if configured) -> openai-codex/gpt-5.3-codex

Additional provider/model setup details

  • Model in use: openai-codex/gpt-5.3-codex (main session runtime)
  • Browser automation path: OpenClaw browser tool via CDP (Chrome, profile openclaw, port 18800)
  • No special per-request model override during reproduction
  • Reproduction appears tied to browser/CDP contention events, not a specific model output quality issue

Logs, screenshots, and evidence

1) CDP/Profile contention errors
- Error: Failed to start Chrome CDP on port 18800 for profile "openclaw".
- process_singleton_posix.cc:345 Failed to create .../SingletonLock: File exists (17)

2) Browser status during incident (partial availability)
- profile: openclaw
- enabled: true
- running: true
- transport: cdp
- cdpPort: 18800
- cdpUrl: http://127.0.0.1:18800
- browser: chrome
- detectedBrowser: chrome
- detectedPath: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

3) Gateway health not fully down
- openclaw status: completed successfully (exit code 0)
- openclaw status --deep: completed successfully (exit code 0)

4) Behavioral symptom evidence
- After CDP contention errors, the main agent intermittently acknowledged actions as if execution would happen, but no concrete execution result followed (execution mismatch / "will-do scam" behavior).

5) Attachments
- Screenshot: browser status output
- Screenshot: CDP failure + SingletonLock output
- Screenshot: conversation turns showing acknowledge-without-execution

Impact and severity

Affected users/systems/channels

  • Users of OpenClaw main agent using browser automation (Chrome CDP profile openclaw) on webchat.
  • Core gateway appears up (openclaw status / --deep succeeded), so impact is not full-system outage.

Severity

  • High workflow impact: agent can acknowledge actions without confirmed execution, reducing operational trust.
  • No observed evidence of direct data loss.

Frequency

  • Intermittent.
  • Reproduced across 2026.3.23 / 2026.3.24 / 2026.3.31 / 2026.4.2 (after updating from 2026.3.22), commonly after CDP contention errors.

Consequence

  • Browser tasks become unreliable after contention events.
  • Users must re-check and retry manually, increasing time cost and risk of missed intended actions.

Additional information

  • Browser/CDP status can show running: true while action-level failures still occur, so process liveness does not guarantee operational readiness.
  • The issue is strongly correlated with CDP/profile contention signals:
    • Failed to start Chrome CDP on port 18800
    • SingletonLock: File exists (17)
  • A separate config warning was present during tests:
    • plugins.entries.qwen-portal-auth: plugin not found This appears unrelated to the execution-mismatch symptom but is included for completeness.
  • Reproduction is easier under rapid/repeated browser actions; strict serialized operations and fixed target usage reduce immediate collision risk but do not eliminate intermittent recurrence.

extent analysis

TL;DR

The main agent's intermittent failure to execute actions after acknowledging them may be resolved by improving the handling of CDP contention events and ensuring the agent's operational readiness before confirming action execution.

Guidance

  • Investigate and address the root cause of CDP contention errors, such as Failed to start Chrome CDP on port 18800 and SingletonLock: File exists (17), to prevent the main agent from entering a broken state.
  • Enhance the agent's logic to verify its operational readiness before acknowledging actions, considering the running: true status does not guarantee execution capability.
  • Implement a retry mechanism or a more robust error handling system to handle intermittent failures and reduce the need for manual retries.
  • Review the configuration and dependencies, including the plugins.entries.qwen-portal-auth warning, to ensure they are not contributing to the issue.

Example

No specific code snippet is provided due to the complexity of the issue and the need for a more comprehensive understanding of the system's architecture.

Notes

The provided information suggests that the issue is closely related to CDP contention events and the main agent's handling of these events. However, without more detailed knowledge of the system's internals, it is challenging to provide a definitive solution. The guidance offered is based on the symptoms and error messages described.

Recommendation

Apply a workaround to improve the handling of CDP contention events and ensure the main agent's operational readiness, as the root cause of the issue appears to be related to these factors. This approach can help mitigate the problem until a more permanent fix can be implemented.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

  • Agent should only confirm execution after a real tool result is received.
  • Browser/CDP contention should be isolated and recovered cleanly.
  • Failures should be explicit, not lead to “acknowledged but not executed” responses.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING