openclaw/docs/tools
Peter Steinberger b2d26e4a61
fix(code-mode): retire warm workers with their host
## What Problem This Solves

Completed Code Mode workers could remain alive after their creating Gateway or CLI command closed. The warm pool and idle-expiry timers had no host lifetime.

## User Impact

Closing a host now waits for its Code Mode workers to retire. Other live hosts keep their workers, and failed native cleanup remains owned for a later retry. Standalone executor calls close completed workers immediately instead of retaining an unowned warm pool. Suspended continuations retain their existing contract.

## Why This Change Was Made

Warm pools capture the existing resource host when created. Each host owns a scheduler scope and its admitted workers; idle expiry uses that scope. Reuse stays within the creating host. The four-worker bound, five-minute idle period, fresh VM contexts, and memory-pressure eviction remain unchanged.

Production: **+65 / -7 / net +58** (`src/**` and `extensions/**`, excluding tests and support). This growth supplies host isolation and joined retirement; this cut is not a LOC reduction. There are no persisted format or configuration changes. Update behavior: existing state remains compatible; the retirement ordering takes effect after restart.

## Evidence

Independent reviews of the production change and the test-fixture correction are clean through P2. Candidate: `6c475248c2ab5b21a3eb0b9e121b38e76d5bffe3`.

- The final source tree passed all 30 tests across the five Code Mode lifecycle/native sibling files in **22.31s pnpm wall**. The native warm-pool fixture now supplies a real host and joins its teardown; the real workers, test bodies, and worker-count assertions are preserved.
- The original production implementation failed the new standalone-worker retirement assertion as intended. The initial 14 lifecycle cases passed in **15.33s pnpm wall**. Full production changed checks passed in **1414.68s**; the final test-only delta passed its changed checks in **205.14s**.
- The final candidate build passed in **434.34s**. Its canonical package passed tarball integrity checks.
- The two native warm-pool failures during development were deterministic fixture mismatches: standalone calls no longer retain a pool, while those tests assert host-owned reuse. This was not a flake fix; no assertions, timeouts, retries, or worker implementations were weakened.

Blacksmith Testbox leases: `tbx_01m3t3g3afjjrmnqjhr0mqasv0` ([native and production proof](https://github.com/openclaw/openclaw/actions/runs/36779653190)) and `tbx_01m3taxfbahdc6c63a38n0fq50` ([final build, fixture checks, and update cell](https://github.com/openclaw/openclaw/actions/runs/36792095804)). The first lease completed at two hours during the fixture changed gate, after all 30 tests passed. The unfinished gate was completed on the fresh lease; the disconnected run is not counted as a passing gate.

The real published `2026.9.7` updater installed the exact candidate in **151s**. Both installed Gateways passed health and joined SIGTERM; the original disabled cron job, workspace bytes, authored configuration, and SQLite integrity were preserved. Doctor applied its existing implicit-main-roster normalization (`agents.entries.main = {}`). The first verification incorrectly expected the whole agents object to remain byte-shaped; source inspection confirmed the existing migration, and a separate read-only verification of the same original artifacts asserted that exact normalization and all remaining preservation checks. The update was not rerun. This cell covers installed update and shutdown; the worker tests above cover warm-worker custody.
2026-10-01 00:41:27 +00:00
..
acp-agents fix: act for the person who asked when several people steer a turn (#160525) 2026-09-28 22:16:34 -07:00
browser improve(browser): show only the current session's tabs in the chat Browser panel (#159891) 2026-09-27 15:16:43 -07:00
code-mode fix(code-mode): retire warm workers with their host 2026-10-01 00:41:27 +00:00
skill-workshop fix(doctor): stop repeated warnings for archived Workshop backups (#161586) 2026-09-30 10:42:40 -07:00
subagents fix(subagents): preserve private result publication during staging (#161820) 2026-09-30 11:37:16 +00:00
tts docs(tts): explain that restricted tool profiles exclude the tts tool (#155950) 2026-09-30 16:52:23 -07:00
acp-agents-setup.md
acp-agents.md refactor: remove Tasks and TaskFlow runtime (#159179) 2026-09-27 10:40:29 -07:00
agent-send.md
apply-patch.md
ask-user.md
brave-search.md
browser-control.md
browser-linux-troubleshooting.md
browser-login.md
browser-wsl2-windows-remote-cdp-troubleshooting.md
browser.md
btw.md
chrome-extension.md
code-execution.md
code-mode.md
creating-skills.md
custodian-skills.md
diffs.md
duckduckgo-search.md
elevated.md
exa-search.md
exec-approvals-advanced.md fix(exec): only name approval surfaces that can answer exec approvals (#159266) 2026-09-26 17:50:25 -07:00
exec-approvals.md
exec.md fix(exec): remove audit-suppression command approval heuristic (#161718) 2026-09-30 01:53:39 -07:00
firecrawl.md docs(firecrawl): link the Firecrawl site and where to get an API key (#157257) 2026-09-30 16:54:55 -07:00
gemini-search.md
goal.md perf(sessions): reuse registry relations across list reads (#160198) 2026-09-28 19:57:41 +00:00
grok-search.md
image-generation.md fix(agents): generated images in shared-main chats run in the background again (#161005) 2026-09-29 00:40:31 -07:00
index.md fix: act for the person who asked when several people steer a turn (#160525) 2026-09-28 22:16:34 -07:00
kimi-search.md
llm-task.md Support isolated sessions in the AgentsAPI and enable restricted dreaming sessions (#159246) 2026-09-26 18:27:06 -07:00
lobster.md refactor: remove Tasks and TaskFlow runtime (#159179) 2026-09-27 10:40:29 -07:00
loop-detection.md fix(computer): unchanged window reads never reach critical loop detection (#160019) 2026-09-28 07:19:06 +05:30
mcp.md
media-overview.md refactor: remove Tasks and TaskFlow runtime (#159179) 2026-09-27 10:40:29 -07:00
minimax-search.md
multi-agent-sandbox-tools.md
music-generation.md fix(agents): generated images in shared-main chats run in the background again (#161005) 2026-09-29 00:40:31 -07:00
ollama-search.md
parallel-search.md
pdf.md fix: PDF analysis uses the active vision model (#159593) 2026-09-28 03:17:57 +05:30
permission-modes.md
perplexity-search.md
plugin.md
progress-card.md fix(ui): progress card stays after dismissing an unfinished or note-only card (#160867) 2026-09-28 18:57:21 -07:00
reactions.md feat: react to prompts and replies with emoji in shared sessions (#161053) 2026-09-30 09:12:24 +00:00
screen.md fix: let people with the same permissions steer each other's turns (#159850) 2026-09-28 13:52:08 +00:00
searxng-search.md
secrets.md
self-learning.md
show-widget.md fix: allow HTML widgets up to 10 MiB (#159970) 2026-09-28 00:37:33 +00:00
skill-workshop.md
skills-config.md
skills.md docs: explain skill readiness and visibility (#146951) 2026-09-30 16:03:34 -07:00
slash-commands.md feat(ui): select Ultrafast for supported accounts (#160352) 2026-09-30 07:45:41 +00:00
steer.md docs: explain that /acp steer runs after the in-flight ACP turn (#154372) 2026-09-26 17:41:34 -07:00
subagents.md refactor: remove Tasks and TaskFlow runtime (#159179) 2026-09-27 10:40:29 -07:00
swarm.md refactor: remove Tasks and TaskFlow runtime (#159179) 2026-09-27 10:40:29 -07:00
tavily.md
theme.md fix: let people with the same permissions steer each other's turns (#159850) 2026-09-28 13:52:08 +00:00
thinking.md feat(ui): select Ultrafast for supported accounts (#160352) 2026-09-30 07:45:41 +00:00
tokenjuice.md
tool-search.md fix: guide direct-only tool calls out of catalog recovery loops (#161055) 2026-09-29 15:49:21 +08:00
trajectory.md
tts.md docs: correct ElevenLabs TTS model configuration key (#161917) 2026-09-30 22:42:58 +08:00
video-generation.md fix(agents): generated images in shared-main chats run in the background again (#161005) 2026-09-29 00:40:31 -07:00
web-fetch.md
web.md