openclaw - 💡(How to fix) Fix [Bug]: Browser tool failures trigger gateway SIGTERM restart instead of graceful error handling [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#59333Fetched 2026-04-08 02:25:50
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
labeled ×1

Browser tool errors (tab not found, CDP disconnect, Chrome process crash) cause the entire OpenClaw gateway to
receive SIGTERM and restart, instead of the error being caught and returned to the agent session gracefully. This creates a crash loop when the agent retries browser actions.

Error Message

receive SIGTERM and restart, instead of the error being caught and returned to the agent session gracefully. This Browser tool should return an error to the agent session (e.g., "tab not found" or "CDP disconnected") without The browser tool errors appear multiple times before the SIGTERM, suggesting the error accumulates until it

Root Cause

Browser tool errors (tab not found, CDP disconnect, Chrome process crash) cause the entire OpenClaw gateway to
receive SIGTERM and restart, instead of the error being caught and returned to the agent session gracefully. This creates a crash loop when the agent retries browser actions.

Fix Action

Fix / Workaround

Gateway config (openclaw.json)

  • agents.defaults.model.primary: xai/grok-4-1-fast-reasoning
  • agents.defaults.model.fallbacks: [openai-codex/gpt-5.4, openai-codex/gpt-5.3-codex,
    lmstudio/qwen_qwen3.5-35b-a3b, nvidia/moonshotai/kimi-k2.5, openrouter/auto, xai/grok-4.20-0309-reasoning]
  • tools.exec: {security: "full", ask: "off"}
  • tools.media: image (google/gemini-3-flash-preview), video (google/gemini-3-flash-preview)
  • agents.defaults.sandbox.browser was toggled by the agent via config.patch during the crash loop

Crash scenario

  • main agent session via Telegram/webchat triggers browser tool
  • browser tool launches Chrome on :18800 (openclaw managed)
  • agent navigates to x.com, performs actions
  • Chrome tab closes or CDP connection drops
  • browser tool returns "tab not found" errors
  • agent attempts config.patch to re-enable sandbox.browser.enabled
  • config.patch triggers gateway restart via restartDelayMs
  • on restart, session resumes from .jsonl transcript, immediately retries browser → loop
  • even failed config.patch validation triggers the restart path

Workaround

  • tools.deny: ["browser"] prevents all browser tool calls
  • manual session clearing (rm agents/main/sessions/*.jsonl) breaks the loop

Code Example

[tools] browser failed: tab not found
  raw_params={"action":"snapshot","targetId":"096521823C69306118207257C1B659D3","compact":true}
  [gateway] signal SIGTERM received
  [gateway] received SIGTERM; shutting down

  The browser tool errors appear multiple times before the SIGTERM, suggesting the error accumulates until it
  triggers a crash or the agent's config.patch attempt to re-enable sandbox browser triggers a restart.
RAW_BUFFERClick to expand / collapse

Bug type

Crash (process/app exits or hangs)

Beta release blocker

Yes

Summary

Browser tool errors (tab not found, CDP disconnect, Chrome process crash) cause the entire OpenClaw gateway to
receive SIGTERM and restart, instead of the error being caught and returned to the agent session gracefully. This creates a crash loop when the agent retries browser actions.

Steps to reproduce

  1. Agent session uses the browser tool to navigate to a page (e.g., x.com)
  2. The Chrome tab is closed or the CDP connection drops
  3. Agent retries with browser snapshot on the now-missing tab
  4. Gateway receives SIGTERM and restarts
  5. On restart, agent session resumes and retries the browser action → restart loop

Expected behavior

Browser tool should return an error to the agent session (e.g., "tab not found" or "CDP disconnected") without
affecting the gateway process. The agent can then decide to retry or abandon the action.

Actual behavior

Gateway receives SIGTERM and fully restarts. On restart, the agent session resumes from its transcript and
immediately retries the failed browser action, causing an infinite restart loop.

OpenClaw version

OpenClaw: 2026.4.1 (also reproduced on 2026.3.28 and 2026.3.31)

Operating system

OS: Linux 6.17.0-19-generic (x64), Ubuntu Zorin OS 18 Core

Install method

npm (global)

Model

grok-4-1-fast-reasoning (xAI)

Provider / routing chain

xai/grok-4-1-fast-reasoning / openai-codex/gpt-5.4 / openai-codex/gpt-5.3-codex / lmstudio/qwen_qwen3.5-35b-a3b / nvidia/moonshotai/kimi-k2.5 / openrouter/auto / xai/grok-4.20-0309-reasoning

Additional provider/model setup details

Gateway config (openclaw.json)

  • agents.defaults.model.primary: xai/grok-4-1-fast-reasoning
  • agents.defaults.model.fallbacks: [openai-codex/gpt-5.4, openai-codex/gpt-5.3-codex,
    lmstudio/qwen_qwen3.5-35b-a3b, nvidia/moonshotai/kimi-k2.5, openrouter/auto, xai/grok-4.20-0309-reasoning]
  • tools.exec: {security: "full", ask: "off"}
  • tools.media: image (google/gemini-3-flash-preview), video (google/gemini-3-flash-preview)
  • agents.defaults.sandbox.browser was toggled by the agent via config.patch during the crash loop

Agent setup

  • main agent: xai/grok-4-1-fast-reasoning (Telegram, WhatsApp, webchat)
  • qwen agent: lmstudio/qwen_qwen3.5-35b-a3b (cron jobs only, local LM Studio)
  • auth-profiles: openai-codex (OAuth), xai (api_key), openrouter (api_key), nvidia (api_key), google (api_key)

Crash scenario

  • main agent session via Telegram/webchat triggers browser tool
  • browser tool launches Chrome on :18800 (openclaw managed)
  • agent navigates to x.com, performs actions
  • Chrome tab closes or CDP connection drops
  • browser tool returns "tab not found" errors
  • agent attempts config.patch to re-enable sandbox.browser.enabled
  • config.patch triggers gateway restart via restartDelayMs
  • on restart, session resumes from .jsonl transcript, immediately retries browser → loop
  • even failed config.patch validation triggers the restart path

Workaround

  • tools.deny: ["browser"] prevents all browser tool calls
  • manual session clearing (rm agents/main/sessions/*.jsonl) breaks the loop

Logs, screenshots, and evidence

[tools] browser failed: tab not found
  raw_params={"action":"snapshot","targetId":"096521823C69306118207257C1B659D3","compact":true}
  [gateway] signal SIGTERM received
  [gateway] received SIGTERM; shutting down

  The browser tool errors appear multiple times before the SIGTERM, suggesting the error accumulates until it
  triggers a crash or the agent's config.patch attempt to re-enable sandbox browser triggers a restart.

Impact and severity

Impact: High — gateway becomes unusable in a restart loop, all channels (Telegram, WhatsApp), cron jobs, and
dashboard go down until sessions are manually cleared

Severity: Critical

Additional information

  • The issue is amplified when the agent has a persistent plan in its session transcript that involves browser automation — each restart resumes the plan and re-triggers the failure.
    • config.patch calls from the agent to modify agents.defaults.sandbox.browser.enabled also trigger gateway restarts even when the patch fails validation, compounding the loop.
    • Workaround: Adding browser to tools.deny in openclaw.json prevents the crash loop entirely but disables all browser functionality.

extent analysis

TL;DR

The most likely fix is to catch and handle browser tool errors, such as "tab not found" or "CDP disconnected", to prevent the gateway from receiving SIGTERM and restarting.

Guidance

  • Investigate the browser tool error handling to ensure that errors are properly caught and returned to the agent session without affecting the gateway process.
  • Review the config.patch validation to prevent gateway restarts when the patch fails validation.
  • Consider implementing a retry mechanism with a limited number of attempts to prevent infinite restart loops.
  • Examine the tools.deny workaround to determine if it can be modified to allow specific browser tool calls while preventing the crash loop.

Example

No code snippet is provided as the issue does not contain sufficient information about the specific code implementation.

Notes

The issue seems to be related to the handling of browser tool errors and the restart mechanism triggered by config.patch calls. The provided workaround, adding browser to tools.deny, prevents the crash loop but disables all browser functionality.

Recommendation

Apply the workaround by adding browser to tools.deny in openclaw.json to prevent the crash loop, and then investigate and implement a proper error handling mechanism to allow browser functionality while preventing the restart loop. This is a temporary solution to prevent the gateway from becoming unusable, and a more permanent fix should be implemented to handle browser tool errors properly.

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

Browser tool should return an error to the agent session (e.g., "tab not found" or "CDP disconnected") without
affecting the gateway process. The agent can then decide to retry or abandon the action.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING