← Back to PRs

#14784: fix(browser): clarify stale targetId errors (tab not found)

by sovushik open 2026-02-12 16:42 View on GitHub →
size: XS
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