openclaw/docs
Onur 424d2dddf5
fix: prevent act:evaluate hangs from getting browser tool stuck/killed (#13498)
* fix(browser): prevent permanent timeout after stuck evaluate

Thread AbortSignal from client-fetch through dispatcher to Playwright
operations. When a timeout fires, force-disconnect the Playwright CDP
connection to unblock the serialized command queue, allowing the next
call to reconnect transparently.

Key changes:
- client-fetch.ts: proper AbortController with signal propagation
- pw-session.ts: new forceDisconnectPlaywrightForTarget()
- pw-tools-core.interactions.ts: accept signal, align inner timeout
  to outer-500ms, inject in-browser Promise.race for async evaluates
- routes/dispatcher.ts + types.ts: propagate signal through dispatch
- server.ts + bridge-server.ts: Express middleware creates AbortSignal
  from request lifecycle
- client-actions-core.ts: add timeoutMs to evaluate type

Fixes #10994

* fix(browser): v2 - force-disconnect via Connection.close() instead of browser.close()

When page.evaluate() is stuck on a hung CDP transport, browser.close() also
hangs because it tries to send a close command through the same stuck pipe.

v2 fix: forceDisconnectPlaywrightForTarget now directly calls Playwright's
internal Connection.close() which locally rejects all pending callbacks and
emits 'disconnected' without touching the network. This instantly unblocks
all stuck Playwright operations.

closePlaywrightBrowserConnection (clean shutdown) now also has a 3s timeout
fallback that drops to forceDropConnection if browser.close() hangs.

Fixes permanent browser timeout after stuck evaluate.

* fix(browser): v3 - fire-and-forget browser.close() instead of Connection.close()

v2's forceDropConnection called browser._connection.close() which corrupts
the entire Playwright instance because Connection is shared across all
objects (BrowserType, Browser, Page, etc.). This prevented reconnection
with cascading 'connectOverCDP: Force-disconnected' errors.

v3 fix: forceDisconnectPlaywrightForTarget now:
1. Nulls cached connection immediately
2. Fire-and-forgets browser.close() (doesn't await — it may hang)
3. Next connectBrowser() creates a fresh connectOverCDP WebSocket

Each connectOverCDP creates an independent WebSocket to the CDP endpoint,
so the new connection is unaffected by the old one's pending close.
The old browser.close() eventually resolves when the in-browser evaluate
timeout fires, or the old connection gets GC'd.

* fix(browser): v4 - clear connecting state and remove stale disconnect listeners

The reconnect was failing because:
1. forceDisconnectPlaywrightForTarget nulled cached but not connecting,
   so subsequent calls could await a stale promise
2. The old browser's 'disconnected' event handler raced with new
   connections, nulling the fresh cached reference

Fix: null both cached and connecting, and removeAllListeners on the
old browser before fire-and-forget close.

* fix(browser): v5 - use raw CDP Runtime.terminateExecution to kill stuck evaluate

When forceDisconnectPlaywrightForTarget fires, open a raw WebSocket
to the stuck page's CDP endpoint and send Runtime.terminateExecution.
This kills running JS without navigating away or crashing the page.
Also clear connecting state and remove stale disconnect listeners.

* fix(browser): abort cancels stuck evaluate

* Browser: always cleanup evaluate abort listener

* Chore: remove Playwright debug scripts

* Docs: add CDP evaluate refactor plan

* Browser: refactor Playwright force-disconnect

* Browser: abort stops evaluate promptly

* Node host: extract withTimeout helper

* Browser: remove disconnected listener safely

* Changelog: note act:evaluate hang fix

---------

Co-authored-by: Bob <bob@dutifulbob.com>
2026-02-11 07:54:48 +08:00
..
.i18n Docs: seed ja-JP translations 2026-02-08 10:18:04 -08:00
assets docs(onboarding): add bootstrapping page (#9767) 2026-02-05 12:08:35 -05:00
automation fix(cron): share isolated announce flow + harden cron scheduling/delivery (#11641) 2026-02-07 19:46:01 -08:00
channels feat: IRC — add first-class channel support 2026-02-10 17:33:57 -06:00
cli Onboard: rename Custom API Endpoint to Custom Provider 2026-02-10 07:36:04 -05:00
concepts docs: clarify which workspace files are injected into context window (#12937) 2026-02-10 10:06:23 -05:00
debug Docs: enable markdownlint autofixables except list numbering (#10476) 2026-02-06 10:08:59 -05:00
diagnostics Docs: add nav titles across docs (#5689) 2026-01-31 15:04:03 -06:00
experiments fix: prevent act:evaluate hangs from getting browser tool stuck/killed (#13498) 2026-02-11 07:54:48 +08:00
gateway Commands: add commands.allowFrom config 2026-02-09 23:58:52 -06:00
help refactor: unify peer kind to ChatType, rename dm to direct (#11881) 2026-02-09 09:20:52 +09:00
hooks docs: canonicalize docs paths and align zh navigation (#11428) 2026-02-07 15:40:35 -05:00
images Channels: finish Feishu/Lark integration 2026-02-03 14:27:39 -08:00
install feat: `ClawDock` - shell docker helpers for OpenClaw development (#12817) 2026-02-10 16:04:41 -05:00
ja-JP docs: fix ja-JP dashboard URL link 2026-02-09 11:26:27 -06:00
nodes docs: add symptom-first troubleshooting hub and deep runbooks (#11196) 2026-02-07 10:28:19 -05:00
platforms chore(release): 2026.2.9 2026-02-09 11:19:07 -06:00
plugins docs: canonicalize docs paths and align zh navigation (#11428) 2026-02-07 15:40:35 -05:00
providers Update Together default model to together/moonshotai/Kimi-K2.5 (#13324) 2026-02-11 08:39:15 +09:00
refactor refactor: unify peer kind to ChatType, rename dm to direct (#11881) 2026-02-09 09:20:52 +09:00
reference Docs: restore maintainers in contributing 2026-02-10 10:33:32 -06:00
security Centralize date/time formatting utilities (#11831) 2026-02-08 04:53:31 -08:00
start Onboard: rename Custom API Endpoint to Custom Provider 2026-02-10 07:36:04 -05:00
tools Commands: add commands.allowFrom config 2026-02-09 23:58:52 -06:00
web docs: canonicalize docs paths and align zh navigation (#11428) 2026-02-07 15:40:35 -05:00
zh-CN docs: fix broken links checker and add CI docs (#13041) 2026-02-09 18:30:05 -08:00
CNAME refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
brave-search.md Docs: enable markdownlint autofixables except list numbering (#10476) 2026-02-06 10:08:59 -05:00
ci.md docs: fix broken links checker and add CI docs (#13041) 2026-02-09 18:30:05 -08:00
date-time.md Docs: add nav titles across docs (#5689) 2026-01-31 15:04:03 -06:00
docs.json feat: IRC — add first-class channel support 2026-02-10 17:33:57 -06:00
index.md Docs: enable markdownlint autofixables except list numbering (#10476) 2026-02-06 10:08:59 -05:00
logging.md Docs: add nav titles across docs (#5689) 2026-01-31 15:04:03 -06:00
network.md docs: canonicalize docs paths and align zh navigation (#11428) 2026-02-07 15:40:35 -05:00
perplexity.md Docs: enable markdownlint autofixables except list numbering (#10476) 2026-02-06 10:08:59 -05:00
pi-dev.md Docs: enable markdownlint autofixables except list numbering (#10476) 2026-02-06 10:08:59 -05:00
pi.md fix: align pi-coding-agent typings and docs 2026-02-01 16:08:01 -08:00
prose.md docs: canonicalize docs paths and align zh navigation (#11428) 2026-02-07 15:40:35 -05:00
style.css Docs: streamline start and install docs (#9648) 2026-02-05 10:09:45 -05:00
tts.md Docs: add nav titles across docs (#5689) 2026-01-31 15:04:03 -06:00
vps.md Docs: enable markdownlint autofixables except list numbering (#10476) 2026-02-06 10:08:59 -05:00
whatsapp-openclaw-ai-zh.jpg Docs: add zh-CN landing notice + AI image 2026-02-02 18:35:01 +01:00
whatsapp-openclaw.jpg refactor: rename to openclaw 2026-01-30 03:16:21 +01:00