Skip to content

fix: keep chat usable after removing an unavailable tool server - #171397

Merged
RomneyDa merged 1 commit into
openclaw:mainfrom
joelagnel:fix/process-startup-cleanup-1717
Oct 15, 2026
Merged

RomneyDa merged 1 commit into
openclaw:mainfrom
joelagnel:fix/process-startup-cleanup-1717

Conversation

@joelagnel

@joelagnel joelagnel commented Oct 13, 2026 •

Copy link
Copy Markdown

Related: openclaw/openclaw-windows-node#1717

What Problem This Solves

Fixes later chat turns failing after an unavailable stdio tool server is removed on POSIX process-group runtimes.

User Impact

Users can remove a server whose executable cannot start and continue the same conversation. The original launch error and retry diagnostic remain visible.

Why This Change Was Made

Failed command startup never sends ready, so the cleanup owner lost the process-group anchor identity. Include that identity in the failure receipt and join bounded, authoritative cleanup before returning the launch error. Receipt, lineage, relay-exit, and kernel extinction checks remain required; genuine cleanup failures still reject.

Evidence

Regression negative controls on base 8197f6f8cf4 failed for missing anchor identity, premature failed-start readiness, and same-session removal (cleanup could not confirm closure). The production owner files in the rebased parent are unchanged from that baseline. With this fix, the real-process session regression removes the unavailable server and prepares the next turn successfully.

Required proof pools

Gateway-only change. Windows integration evidence covers windows-11-arm64 and windows-winui-interactive from the Companion proof pools. The real Gateway path was exercised on Linux with Bun; windows-wsl-gateway-e2e is not qualified by this proof.

Validation

Final source tree at b882bbf627b410599fe231e2a917b4d6a80e76d3:

  • pnpm build:runtime: passed, 45.9s.
  • node scripts/run-vitest.mjs with the nine affected lifecycle test files: 97 passed, 2 Windows-only skipped, 44.61s.
  • pnpm build:plugin-sdk:dts and canonical scripts/package-openclaw-for-docker.mjs --allow-unreleased-changelog --skip-build: passed. The package identifies the exact final commit and passed inventory/import integrity validation.
  • Core type check, six-file type-aware lint, formatting, and git diff --check: passed.
  • Independent code review, structured review, and final commit-coherence review: clean. The final amendment only corrected committer metadata; its source tree is identical to the reviewed and tested tree.
  • The optional repository-wide changed check flags an inherited max-lines suppression in src/commands/doctor-database-port.ts. That file and its baseline are byte-identical to the PR parent, outside this fix. Additional broad test type graphs are covered by PR CI.

Real behavior proof

Final-head live proof, correlated Gateway diagnostic, and screenshot.

The test used actual Store Companion 2026.9.803.0, Windows 11 ARM64, local qwen3.6-35b-a3b-mtp-ud-q4-k-s (32,768 context), and an isolated Linux Gateway on official Bun 1.4.3. Configuration: tools.profile=minimal, tools.alsoAllow=["bundle-mcp"]; stdio server blender-mcp, command /mnt/c/openclaw-issue-1717-missing/uvx.exe, argument blender-mcp. Live changes used config.get / config.patch with revision and destructive-array acknowledgements.

The supported package updater transitioned official stable 2026.10.3 (59cb44796b0f) to the exact validated candidate (also manifest 2026.10.3) and reported status: ok. Settings, workspace, model, tools, the Companion Gateway record, stored device credential, and conversation survived. The old host exited cleanly on replaced installation identity; the candidate was then activated. No older-host recovery or mixed-version host retention is claimed.

The activated candidate retained its Gateway PID through real stdio worker replacement, discovery, invocation, removal, and confirmed closure. In the same conversation, missing-executable startup then produced ENOENT/unavailable diagnostics; removal succeeded without restart, and UPGRADE_RECOVERY_1717 plus UPGRADE_FOLLOWUP_1717 completed while Connected. Neither cleanup warning appeared.

Final-head Companion remains Connected and completes recovery and follow-up after unavailable-server removal

Not verified: WSL packaging, the original installer readiness contradiction, and the originally reported repeated restart loop. This PR addresses the reproduced cleanup follow-on failure; the broader related issue remains open. Bun exercises the repaired POSIX owner; existing native Node/Linux cleanup repairs are prior work.

@clawsweeper

clawsweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S labels Oct 13, 2026
@joelagnel
joelagnel marked this pull request as ready for review October 13, 2026 21:55
@joelagnel

Copy link
Copy Markdown
Author

@clawsweeper re-review

Proof on head e7fb9f4732d: runtime build passed; the nine-file lifecycle suite passed 97 tests, with two Windows-only skips. Negative controls on the base failed for missing owner identity, premature readiness rejection, and same-conversation removal cleanup. The fix passes those regressions while preserving genuine cleanup failures.

The PR body records the blocked Companion retest and release-package validation. Please review the cleanup ownership change and regression coverage.

@clawsweeper

clawsweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 13, 2026
@clawsweeper

clawsweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

The PR preserves the process-group anchor identity after failed tool-server startup and joins authoritative cleanup before returning the launch error.

Example: Remove blender-mcp after /mnt/c/openclaw-issue-1717-missing/uvx.exe fails with ENOENT.

  • Before: The next turn in the same conversation can fail with MCP runtime cleanup could not confirm closure.
  • After: Removal completes and two subsequent replies succeed while the Companion remains Connected.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Strong shipped-entry-point proof and a focused, correct patch; this addresses only the cleanup portion of the broader linked issue.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Inspected screenshots and final-head live output exercise Store Companion on Windows ARM64 against an isolated Linux Bun Gateway: unavailable-server removal permits two later replies without restarting the candidate Gateway. The supported latest-stable update preserves settings, workspace, model, tools, device credentials, and conversation; candidate worker replacement also completes discovery, invocation, and closure. This resolves the previous proof request without claiming WSL packaging or reproduction of the separate restart loop.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: Removing an unavailable stdio tool server can leave later turns in the same conversation failing.
Reason: The scoped cleanup repair has clear user value and uses the existing owner; Related wording correctly leaves the broader linked report's setup and restart expectations open.

Merge readiness

✅ Ready for maintainer review

This PR fixes a concrete cleanup failure still present on current main, with sufficient final-head behavior and upgrade proof; no actionable introduced bugs were found.

Priority: P1
Reviewed head: b882bbf627b410599fe231e2a917b4d6a80e76d3

Before merge

None.

Findings

None.

Agent review details

How this fits together

The shared process supervisor launches and retires stdio children for MCP and other consumers; startup receipts and lifecycle observations determine whether callers receive an ordinary launch error or uncertain cleanup.

flowchart LR
  A[Conversation turn] --> B[Session MCP runtime]
  B --> C[Owned stdio process]
  C --> D[Relay host]
  D --> E[Process group anchor]
  E --> F[Tool server executable]
  E --> G[Startup and closing receipts]
  G --> D
Loading

Technical review

Best possible solution:

Land the focused shared-supervisor repair and retain the broader Companion report for its separate setup and restart symptoms.

Do we have a high-confidence way to reproduce the issue?

Source traces failed startup without a ready receipt to missing anchor identity and retained cleanup uncertainty; the linked report supplies an observed same-conversation failure, and contributor negative controls cover that path.

Is this the best way to solve the issue?

The fix repairs the shared producer and cleanup settlement rather than suppressing MCP errors, while retaining the existing authoritative extinction checks.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 9940ac5fca34.

Provenance checked

  • Failed-start receipt identity keeps the original intent (321f4d3: The recent host-loss repair preserved detailed startup errors while distinguishing explicit stdin closure from host loss.)
  • Startup cleanup settlement keeps the original intent (3477c48: Cleanup outcomes and authority-finalization failures must remain observed instead of escaping as process-level rejections.)
  • Process-group retirement keeps the original intent (ffc94d0: The live anchor owns cancellation; cleanup requires retained lifecycle evidence rather than signaling a stored process-group number.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 321f4d3 adds src/process/supervisor/service-child-group-anchor.ts:203 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 321f4d3ded53; files: src/process/supervisor/service-child-group-anchor.ts)
  • Josh Lehman: Raw commit 9db0482 adds src/process/supervisor/service-child-group-anchor.ts:126 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 9db0482ff890; files: src/process/supervisor/service-child-group-anchor.ts)

PR surface

Source +6, Tests +153. Total +159 across 6 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 3 9 3 +6
Tests 3 154 1 +153
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 163 4 +159

Review metrics

Metric Value Why it matters
Production versus test LOC Production +9/-3; tests +154/-1 Small producer and settlement changes are supported by distinct receipt, ordering, and real-process session regressions.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.
  • remove proof: 📸 screenshot: Current real behavior proof evidence kind is live_output.

Label justifications:

  • P1: A missing executable can poison cleanup and break later chat turns even after the unavailable server is removed.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (3 earlier review cycles)
  • reviewed 2026-10-13T22:01:59.395Z sha e7fb9f4732ddfa13916b9c35137c368a683576fe :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-13T22:09:06.702Z sha e7fb9f4732ddfa13916b9c35137c368a683576fe :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-13T23:11:58.574Z sha b882bbf :: needs real behavior proof before merge. :: none

Reviewed October 13, 2026, 7:22 PM ET / 23:22 UTC (Revision 4).

@joelagnel

Copy link
Copy Markdown
Author

Current-head Companion recovery proof is now PASS at e7fb9f4732ddfa13916b9c35137c368a683576fe.

Actual Store Companion 2026.9.803.0 on Windows 11 ARM64, local qwen3.6-35b-a3b-mtp-ud-q4-k-s (32,768 context), and an isolated Linux Gateway on official Bun 1.4.3. Normal shared-token authentication and explicit device pairing were used. This exercises the repaired POSIX process-group owner; it is not a WSL packaging qualification.

The unavailable stdio server was blender-mcp, command /mnt/c/openclaw-issue-1717-missing/uvx.exe, argument blender-mcp. Changes went through live config.get / config.patch with their revision and destructive-array acknowledgements.

Gateway head e7fb9f4732ddfa13916b9c35137c368a683576fe; Bun 1.4.3; Store Companion 2026.9.803.0; Windows 11 ARM64; local Qwen3.6-35B-A3B UD-Q4_K_S; context 32768
One conversation: agent:main:main
CLEANUP_BASELINE_1717: PASS, Companion Connected
config.patch add: accepted, restart not required
BLENDER_UNAVAILABLE_1717: PASS, Companion Connected
config.patch remove: accepted, restart not required
CLEANUP_RECOVERY_1717: PASS, Companion Connected
CLEANUP_FOLLOWUP_1717: PASS, Companion Connected
Gateway PID unchanged; no restart; ENOENT and unavailable/retry diagnostic recorded; cleanup identity/closure warnings absent; protocol 4

The screenshot shows the unavailable response and both later successful replies in the same conversation, with Connected visible.

Companion remains Connected and completes recovery and follow-up replies after server removal

Required CI remains green. Latest-stable transition and retained-host helper compatibility proof are still in progress. The original setup readiness error and repeated restart loop remain unverified; this is the cleanup follow-on fix.

Failed POSIX command startup never emits ready. Include the live anchor identity in its startup failure receipt and join bounded authoritative cleanup before returning the original launch error.

Add producer, readiness-ordering, and same-session removal regressions. Preserve receipt, lineage, relay-exit, and process-group extinction checks.
@joelagnel
joelagnel force-pushed the fix/process-startup-cleanup-1717 branch from e7fb9f4 to b882bbf Compare October 13, 2026 23:05
@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Oct 13, 2026
@joelagnel

Copy link
Copy Markdown
Author

Final-head live proof is PASS at b882bbf627b410599fe231e2a917b4d6a80e76d3.

The supported updater transitioned official stable 2026.10.3 (59cb44796b0f) to the validated candidate archive (manifest 2026.10.3, exact PR commit). It reported status: ok; candidate Doctor, lint, config, plugins, recovery, startup canary, and package swap all succeeded. Configuration, workspace, model, tools, the Companion Gateway record, stored device credential, and conversation were preserved.

The old host exited cleanly when its published installation identity changed, as required by that release. This is not a claim that an older host gains the fix without activation. After activation, a controlled stdio worker replacement retained the candidate Gateway PID, used a fresh worker generation, passed real discovery/invocation, and confirmed closure on removal.

Actual Store Companion 2026.9.803.0 on Windows 11 ARM64 and local Qwen were used with the isolated Linux Gateway on official Bun 1.4.3. The missing server configuration and tool grants are documented in the PR body. This qualifies the repaired POSIX owner, not WSL packaging or the original installer/restart loop.

Candidate b882bbf627b410599fe231e2a917b4d6a80e76d3; manifest 2026.10.3; official Bun 1.4.3; Store Companion 2026.9.803.0
Latest-stable 2026.10.3 (59cb44796b0f) to exact candidate: supported npm update --tag <validated candidate archive> --no-restart --yes --json: status ok
Candidate Doctor, lint, config, plugins, recovery, startup canary and package swap: PASS
Old host exited cleanly on replaced installation identity; no mixed-version host retention is claimed
Existing Companion Gateway record and stored device credential reconnect: PASS
Gateway, model, tools, workspace and stdio configuration preserved: PASS
UPGRADE_CONTINUITY_1717: PASS, Companion Connected
HEAD_WORKER_INITIAL_1717: tools/list and tools/call PASS, Companion Connected
Only the owned stdio fixture executable was stopped; Gateway retained
HEAD_WORKER_REPLACED_1717: tools/list and tools/call PASS, Companion Connected
Fresh worker generation started and acknowledged removal/closure: PASS; Gateway PID unchanged
config.patch add: accepted, restart not required
UPGRADE_UNAVAILABLE_1717: PASS, Companion Connected
config.patch remove: accepted, restart not required
UPGRADE_RECOVERY_1717: PASS, Companion Connected
UPGRADE_FOLLOWUP_1717: PASS, Companion Connected
Same conversation preserved across activation; unavailable-server removal and two later replies PASS while Connected; Gateway PID unchanged; cleanup warnings absent; protocol 4

Correlated Gateway diagnostic:

2026-10-13T19:08:49.165-04:00 [bundle-mcp] failed to start server "blender-mcp" (/mnt/c/openclaw-issue-1717-missing/uvx.exe blender-mcp): ENOENT: no such file or directory, posix_spawn '/mnt/c/openclaw-issue-1717-missing/uvx.exe'; server unavailable; retry after 2026-10-13T23:08:54.164Z. Check server reachability or reload MCP after fixing it.

The screenshot directly shows the unavailable response, both successful later replies, and Connected in the same conversation after the stable-to-candidate transition.

Final-head Companion completes recovery and follow-up replies after unavailable-server removal while Connected

The rebased runtime build, nine-file lifecycle suite (97 passed, 2 Windows-only skipped), SDK declarations, canonical package integrity, core type check, six-file type-aware lint, formatting, independent/structured reviews, and final commit-coherence review passed. The optional repository-wide changed check flags an inherited max-lines suppression in src/commands/doctor-database-port.ts; that file and its baseline are byte-identical to the PR parent and are outside this fix. Remaining broad test type graphs are delegated to CI.

ClawSweeper is already reviewing this head; this evidence addresses its previous proof request.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. labels Oct 13, 2026
@RomneyDa
RomneyDa merged commit 3ab06f3 into openclaw:main Oct 15, 2026
139 checks passed
RomneyDa pushed a commit that referenced this pull request Oct 16, 2026
)

Failed POSIX command startup never emits ready. Include the live anchor identity in its startup failure receipt and join bounded authoritative cleanup before returning the original launch error.

Add producer, readiness-ordering, and same-session removal regressions. Preserve receipt, lineage, relay-exit, and process-group extinction checks.

Co-authored-by: Joel Fernandes <[email protected]>
(cherry picked from commit 3ab06f3)
RomneyDa added a commit that referenced this pull request Oct 16, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
…claw#171397)

Failed POSIX command startup never emits ready. Include the live anchor identity in its startup failure receipt and join bounded authoritative cleanup before returning the original launch error.

Add producer, readiness-ordering, and same-session removal regressions. Preserve receipt, lineage, relay-exit, and process-group extinction checks.

Co-authored-by: Joel Fernandes <[email protected]>
RomneyDa pushed a commit that referenced this pull request Oct 16, 2026
)

Failed POSIX command startup never emits ready. Include the live anchor identity in its startup failure receipt and join bounded authoritative cleanup before returning the original launch error.

Add producer, readiness-ordering, and same-session removal regressions. Preserve receipt, lineage, relay-exit, and process-group extinction checks.

Co-authored-by: Joel Fernandes <[email protected]>
(cherry picked from commit 3ab06f3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants