openclaw - 💡(How to fix) Fix [Bug]: claude-cli harness deregisters on session abort, cascades to subagent failure and announce loop on 2026.4.24 [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#72257Fetched 2026-04-27 05:32:26
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Timeline (top)
closed ×1commented ×1

On OpenClaw v2026.4.24 (macOS), a subagent session using claude-cli/claude-opus-4-6 was aborted mid-run when the session went quiet during large file reads. After the abort, the claude-cli harness deregistered, and every subsequent dispatch failed instantly with the same error — including the runtime's own announce/completion mechanism. The session's auto-announce retried 3 times and gave up with no user-visible notification.

This is related to (but distinct from) #71957 "Gateway startup race." That issue covered harness registration at startup. This issue covers harness deregistration at runtime when a CLI session is aborted.

Error Message

08:35:03 [agent/cli-backend] claude live session start: provider=claude-cli model=claude-opus-4-6 activeSessions=2 08:36:07 [agent/cli-backend] claude live session turn: durationMs=133734 rawLines=1689 08:44:36 [agent/cli-backend] claude live session close: provider=claude-cli model=claude-opus-4-6 reason=abort 08:44:37 [ws] ⇄ res ✗ errorCode=UNAVAILABLE errorMessage=Error: Requested agent harness "claude-cli" is not registered and PI fallback is disabled. 08:45:07 [ws] ⇄ res ✗ errorCode=UNAVAILABLE (announce retry 1) 08:45:08 [ws] ⇄ res ✗ errorCode=UNAVAILABLE (announce retry 2, cached=true) 08:46:07 [agent/cli-backend] claude live session close: reason=idle (a separate session, re-registers harness) 08:46:14 [ws] ⇄ res ✗ errorCode=UNAVAILABLE (announce retry 3 give-up, cached=true) 08:46:14 [warn] Subagent announce give up (retry-limit) run=d86a5df6 retries=3 endedAgo=97s

Root Cause

On OpenClaw v2026.4.24 (macOS), a subagent session using claude-cli/claude-opus-4-6 was aborted mid-run when the session went quiet during large file reads. After the abort, the claude-cli harness deregistered, and every subsequent dispatch failed instantly with the same error — including the runtime's own announce/completion mechanism. The session's auto-announce retried 3 times and gave up with no user-visible notification.

This is related to (but distinct from) #71957 "Gateway startup race." That issue covered harness registration at startup. This issue covers harness deregistration at runtime when a CLI session is aborted.

Fix Action

Fix / Workaround

On OpenClaw v2026.4.24 (macOS), a subagent session using claude-cli/claude-opus-4-6 was aborted mid-run when the session went quiet during large file reads. After the abort, the claude-cli harness deregistered, and every subsequent dispatch failed instantly with the same error — including the runtime's own announce/completion mechanism. The session's auto-announce retried 3 times and gave up with no user-visible notification.

  1. Spawn a subagent with runtime=subagent, model=claude-cli/claude-opus-4-6, mode=run
  2. Give it a task that involves reading large files (~80-128KB) with no streaming output for 180+ seconds
  3. The gateway's no-output timeout aborts the CLI session
  4. Check gateway logs — harness immediately reports not registered
  5. Any subsequent dispatches (including the session's own auto-announce) fail instantly

Code Example

08:35:03 [agent/cli-backend] claude live session start: provider=claude-cli model=claude-opus-4-6 activeSessions=2
08:36:07 [agent/cli-backend] claude live session turn: durationMs=133734 rawLines=1689
08:44:36 [agent/cli-backend] claude live session close: provider=claude-cli model=claude-opus-4-6 reason=abort
08:44:37 [ws] ⇄ res ✗ errorCode=UNAVAILABLE errorMessage=Error: Requested agent harness "claude-cli" is not registered and PI fallback is disabled.
08:45:07 [ws] ⇄ res ✗ errorCode=UNAVAILABLE (announce retry 1)
08:45:08 [ws] ⇄ res ✗ errorCode=UNAVAILABLE (announce retry 2, cached=true)
08:46:07 [agent/cli-backend] claude live session close: reason=idle  (a *separate* session, re-registers harness)
08:46:14 [ws] ⇄ res ✗ errorCode=UNAVAILABLE (announce retry 3 give-up, cached=true)
08:46:14 [warn] Subagent announce give up (retry-limit) run=d86a5df6 retries=3 endedAgo=97s
RAW_BUFFERClick to expand / collapse

Summary

On OpenClaw v2026.4.24 (macOS), a subagent session using claude-cli/claude-opus-4-6 was aborted mid-run when the session went quiet during large file reads. After the abort, the claude-cli harness deregistered, and every subsequent dispatch failed instantly with the same error — including the runtime's own announce/completion mechanism. The session's auto-announce retried 3 times and gave up with no user-visible notification.

This is related to (but distinct from) #71957 "Gateway startup race." That issue covered harness registration at startup. This issue covers harness deregistration at runtime when a CLI session is aborted.

Steps to reproduce

  1. Spawn a subagent with runtime=subagent, model=claude-cli/claude-opus-4-6, mode=run
  2. Give it a task that involves reading large files (~80-128KB) with no streaming output for 180+ seconds
  3. The gateway's no-output timeout aborts the CLI session
  4. Check gateway logs — harness immediately reports not registered
  5. Any subsequent dispatches (including the session's own auto-announce) fail instantly

Gateway log timeline (exact, 2026-04-26 ~08:35 PDT)

08:35:03 [agent/cli-backend] claude live session start: provider=claude-cli model=claude-opus-4-6 activeSessions=2
08:36:07 [agent/cli-backend] claude live session turn: durationMs=133734 rawLines=1689
08:44:36 [agent/cli-backend] claude live session close: provider=claude-cli model=claude-opus-4-6 reason=abort
08:44:37 [ws] ⇄ res ✗ errorCode=UNAVAILABLE errorMessage=Error: Requested agent harness "claude-cli" is not registered and PI fallback is disabled.
08:45:07 [ws] ⇄ res ✗ errorCode=UNAVAILABLE (announce retry 1)
08:45:08 [ws] ⇄ res ✗ errorCode=UNAVAILABLE (announce retry 2, cached=true)
08:46:07 [agent/cli-backend] claude live session close: reason=idle  (a *separate* session, re-registers harness)
08:46:14 [ws] ⇄ res ✗ errorCode=UNAVAILABLE (announce retry 3 give-up, cached=true)
08:46:14 [warn] Subagent announce give up (retry-limit) run=d86a5df6 retries=3 endedAgo=97s

Key observation: the harness re-registered automatically when a separate CLI session closed cleanly at 08:46:07 — but the announce retries had already given up at 08:46:14.

Impact

  1. Subagent work is silently lost — the session failed partway through, no output written, no notify to user
  2. Auto-announce retry loop also fails (harness still down during the 3-retry window)
  3. User gets no feedback — the spawning session already ended (Discord/Telegram flow), so completion events cannot reach them

Related

  • #71957 covered harness registration at startup (fixed on main, ships next release)
  • This is the "harness deregistration on CLI abort" issue that #71957's body explicitly calls out as a separate issue: "The harness deregistration on CLI abort is a separate issue that amplifies this one"

Suggested fixes

  • Don't deregister the harness on session abort — the harness itself (the plugin + backend) is still alive; only the CLI session died
  • If deregistration is intentional: retry announce after harness re-registration, not just on a fixed timer
  • Increase default no-output timeout for subagent sessions (vs. interactive sessions) — large file reads are legitimate long-quiet operations

Environment

OpenClawv2026.4.24 (cbcfdf6)
OSmacOS 15.6 (arm64)
GatewayLaunchAgent (local loopback)
Primary modelclaude-cli/claude-opus-4-6

extent analysis

TL;DR

The harness deregistration on CLI abort can be fixed by not deregistering the harness when a session is aborted or by retrying the announce after harness re-registration.

Guidance

  • Investigate the harness registration and deregistration logic to determine why the harness is being deregistered when a CLI session is aborted.
  • Consider increasing the default no-output timeout for subagent sessions to accommodate large file reads.
  • Review the announce retry mechanism to ensure it can handle cases where the harness is temporarily deregistered.
  • Verify that the harness re-registration is triggered correctly when a separate CLI session closes cleanly.

Example

No code snippet is provided as the issue does not contain sufficient information to create a specific example.

Notes

The issue is related to but distinct from #71957, which covered harness registration at startup. The suggested fixes provided in the issue body may need to be adapted or combined to fully resolve the problem.

Recommendation

Apply a workaround by increasing the default no-output timeout for subagent sessions to prevent premature aborts during large file reads, while investigating the harness registration and deregistration logic for a more permanent fix.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING