#14784: fix(browser): clarify stale targetId errors (tab not found)
size: XS
Cluster:
Error Handling Improvements
Fixes error messaging when the underlying failure is a stale targetId/tab (e.g. after profile restart).\n\nInstead of surfacing "Can't reach the OpenClaw browser control service" for messages like "tab not found", return a clearer error advising to re-open the page to obtain a fresh targetId.\n\nRelated: openclaw/openclaw#14503
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This change updates `src/browser/client-fetch.ts` to detect common “missing tab/target” error strings (e.g. `tab not found`, `target not found`, `no such target`, `target closed`) and return a clearer, user-directed message indicating the `targetId` is stale and they should re-open the page to obtain a fresh targetId.
The logic sits in the shared error-enhancement layer (`enhanceBrowserFetchError`) used by `fetchBrowserJson`, so it affects both the internal browser control-service dispatcher path and any callers that surface these error messages through this fetch wrapper.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- Change is narrowly scoped to error-message mapping in a single helper, and the matched strings are consistently used in the codebase for missing/invalid tab/targetId scenarios. No behavior changes to the control path beyond improving the surfaced error message.
- No files require special attention
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#18907: Fix: Improve browser error messages to avoid misleading agents
by jriff · 2026-02-17
81.0%
#23668: fix: distinguish browser validation errors from connectivity failures
by davidemanuelDEV · 2026-02-22
79.8%
#6193: fix(browser): default to openclaw profile instead of chrome extensi...
by mikezaoldyeck · 2026-02-01
78.7%
#10367: CLI/Ops: resilient browser fill + failover hardening + operations t...
by cluster2600 · 2026-02-06
77.5%
#14944: fix(browser): prefer openclaw profile in headless/noSandbox environ...
by BenediktSchackenberg · 2026-02-12
77.2%
#8614: fix(browser): detect early chromium exit to prevent startup hang
by Wren-OC · 2026-02-04
76.6%
#3794: fix(browser-tool): disallow close without targetId to avoid unsafe ...
by JaydenLiang · 2026-01-29
76.4%
#15595: fix(browser): avoid local port conflicts for remote cdp
by TsekaLuk · 2026-02-13
76.0%
#23363: Browser: fallback to managed profile and improve runtime diagnostics
by isdoho · 2026-02-22
75.9%
#13568: Fix browser (OpenClaw-managed) launch fail by binding remote debugg...
by singlag · 2026-02-10
75.9%