Skip to content

fix(agents): CLI-backed agents stop replying when a long turn trips stuck-session recovery - #138280

Merged
obviyus merged 10 commits into
openclaw:mainfrom
anandnsharma:fix/cli-backend-stream-liveness-watchdog
Sep 5, 2026
Merged

obviyus merged 10 commits into
openclaw:mainfrom
anandnsharma:fix/cli-backend-stream-liveness-watchdog

Conversation

@anandnsharma

@anandnsharma anandnsharma commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Continues #137372 on the original contributor branch. Thanks @anandnsharma and @anand-thepasselgroup for the report, implementation and prior proof. The maintainer repair and validation are AI-assisted.

What Problem This Solves

Healthy CLI-backed turns can keep producing output while generic stuck-session recovery treats them as silent. Recovery can then abort the turn before its answer reaches the chat channel.

The independent Telegram reproduction showed real text arriving only 245 ms before recovery interrupted the turn at 387 seconds. The normal recovery threshold was 360 seconds; the CLI backend's existing quiet allowance was 600 seconds.

Why This Change Was Made

The CLI producer did not keep the existing recovery owner informed of its output and allowance. The submitted session-ref deadline table also let one finishing call erase another call's allowance.

The repair keeps those facts with the exact existing lifecycle owner:

  • Register the resolved backend quiet allowance before waiting for first output.
  • Refresh it from real stdout and record model-stream progress through one shared reporter.
  • Reject observations after owner closure, replacement or execution expiry.
  • Release only the settling backend attempt, including overlapping serialize:false calls.
  • Keep active-tool progress and its bounded recovery policy separate from transport chatter.
  • Keep committed replies with their existing bounded finalization lease.

The separate session-ref deadline store is removed. Existing session index and merge logic is moved into its state module; it is not a second store. No global timeout, configuration option, schema, protocol or privileged plugin grant is added.

User Impact

Long, healthy CLI-backed turns keep their answers and deliver them to the channel. Genuinely silent calls still expire. Cancellation, replacement and finalization keep their existing owners.

This does not claim to address the distinct direct-provider problem in #137263 or the separate quiet-background-task work.

Production: +754/-500, net +254. Tests/support: +1921/-1152, net +769, including suite moves. The production growth supplies exact-owner observation and revocation plus committed-finalization protection. A global timeout increase or a session-only table cannot provide those guarantees.

Evidence

Real Telegram and native CLI

Telegram Test Server user DM → isolated built Gateway → real Claude CLI, using claude-opus-4-6.

Case Observed result
Baseline 407a8f453c0f0306af1ddc0aafa8697c1d49a9e7 37 real text deltas after 360 seconds; recovery interrupted the turn at 387 seconds, 245 ms after its last delta. Telegram received the incorrect stopped-progress notice.
Original repaired SDK runtime Text-only turn completed in 609.7 seconds with no tools; recovery reported fresh stream progress at 597 seconds. Telegram completed delivery at 694.4 seconds.
Integrated direct-CLI runtime 19d741520877d87d4432f736c7821c16dc6bf2a5 781 text deltas, including 278 after 360 seconds; no tools. The model completed a 101,635-character answer in 556.7 seconds. Telegram received all 37 chunks, ending at 626.6 seconds.
Silent CLI Paused the real process after its first text delta. Its unchanged 600-second no-output limit terminated it. Telegram received the timeout notice and the next request replied normally.
Cancellation and replacement /stop aborted the active turn; the replacement request replied normally.
Committed finalization Telegram accepted the answer while its response callback was held for 35.5 seconds. Finalization completed after release, and the next request replied normally.
Native tool path Claude actually called Bash to run node --version; the matching tool result was v24.20.0, and Telegram received it.

The full prompt fits the observed 200,000-token context and 64,000-token output limit. No fake provider output, shortened recovery watchdog or source-import probe was used as live red/green evidence.

The final head ff1b4ffd578370bcf10170f6f6f7d319dd34422d adds only the explicit overlap test after the integrated runtime. Production, dependencies, build inputs and live scenario inputs are unchanged. The actual 19d7415 package and its original stamps are retained; it is not relabeled as a build of the test-only commit.

Focused validation

514 distinct tests across 22 files passed. The new overlap case failed with the baseline producer's missing allowance, then all 75 tests in its file passed with the repair. Its ordering verifies that the first call's completion and owner closure preserve the second call's allowance.

node scripts/run-vitest.mjs \
  src/auto-reply/reply/reply-run-registry.control-owner.test.ts \
  src/logging/diagnostic-stuck-session-recovery.runtime.test.ts \
  src/logging/diagnostic.test.ts \
  src/logging/diagnostic-run-activity.test.ts \
  src/logging/diagnostic-stuck-session-recovery.integration.test.ts \
  src/logging/diagnostic-backend-liveness.test.ts \
  src/logging/diagnostic-stuck-session-followup-recovery.integration.test.ts \
  src/logging/diagnostic-lifecycle.test.ts \
  src/auto-reply/reply/reply-run-registry.test.ts \
  src/auto-reply/reply/dispatch-from-config.stale-recovery.test.ts \
  src/agents/embedded-agent-runner/runs.force-clear-terminal.test.ts \
  src/agents/embedded-agent-runner/runs.generation.test.ts \
  src/agents/embedded-agent-runner/runs.liveness.test.ts \
  src/agents/embedded-agent-runner/runs.diagnostics.test.ts \
  src/agents/embedded-agent-runner/run/deferred-lifecycle-owner.test.ts \
  src/agents/cli-runner/execute.supervisor-capture.test.ts \
  src/agents/cli-runner/execute.pending-cancellation.test.ts \
  src/agents/cli-runner/execute.executable-invocation.test.ts \
  src/agents/cli-runner/cli-live-session-registry.test.ts \
  extensions/anthropic/cli-runtime.test.ts \
  extensions/anthropic/cli-process.test.ts \
  extensions/anthropic/cli-user-input.test.ts
node scripts/run-vitest.mjs \
  extensions/anthropic/cli-runtime.test.ts \
  extensions/anthropic/cli-process.test.ts
node scripts/run-vitest.mjs src/agents/cli-runner/execute.supervisor-capture.test.ts
pnpm tsgo:core
pnpm build qaRuntime
node dist/entry.js --version
git diff --check

The two-file rerun covers the initial fixture-reaping failures; the final single-file run covers the added overlap case. The canonical node scripts/run-tsgo-core-test-shards.mjs --changed-paths-json "$review_paths_json" selection, using the complete final PR changed-path list, passed all 16 core-test graphs. Formatting, scoped lint and the retained selected guards passed. Process-tree tests ran with a standard child reaper; the initial failures and corrected fixture runs remain in the evidence.

Review disposition and limits

  • Both latest ClawSweeper rank-up moves are addressed: the allowance is exact-owner bound, and the overlapping same-session serialize:false regression is present.
  • Two requests for a long idle Bash timer were declined before tool execution. They are retained as failed extra probes, not passes. The accepted native tool call proves the live tool path; deterministic owner tests cover the separate 15-minute policy, explicit tool deadlines and transport-chatter separation. No live 15-minute tool-expiry claim is made.
  • The baseline's final recorder summary was not recovered before its lease ended. Its retained raw stream, recovery and Telegram interruption events establish the red.
  • Full sanitized observations, fixture sources, caller/owner/sibling code and pinned dependency contracts are supplied to the independent exact-head review. No raw account data or agent session transcript is published.
  • Exact-head CI passed. Fresh native independent review of the complete source/proof reported no findings. Its cleanup concern was checked through the production handoff and resolved without a source change.
  • The large recovery test files chiefly relocate an existing 1,101-line suite; the split totals 1,155 lines, a net increase of 54. The existing state maps are moved, not duplicated. The added queue-boundary regressions remain useful.

@clawsweeper

clawsweeper Bot commented Sep 4, 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.

@anandnsharma
anandnsharma marked this pull request as ready for review September 4, 2026 13:24
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XL labels Sep 4, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Sep 4, 2026
@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 5, 2026, 5:03 AM ET / 09:03 UTC.

ClawSweeper review

What this changes

The PR makes CLI-backed agents report output and quiet deadlines to recovery, while protecting completed answers during bounded delivery finalization.

Merge readiness

✅ Ready for maintainer review

The fix remains necessary on current main. Both prior review requests are addressed, the supplied live evidence covers the repaired path, and no new blocking defect was found.

Priority: P1
Reviewed head: ff1b4ffd578370bcf10170f6f6f7d319dd34422d

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent owner-boundary repair with strong reported live coverage and both prior review requests resolved.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The supplied live observations exercise the changed CLI owner through Telegram Test Server and a built Gateway, showing complete long-turn delivery plus silent expiry, cancellation/replacement, and held finalization; the final commit changes only the overlap test.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The supplied live observations exercise the changed CLI owner through Telegram Test Server and a built Gateway, showing complete long-turn delivery plus silent expiry, cancellation/replacement, and held finalization; the final commit changes only the overlap test.
Evidence reviewed 10 items Pinned change and proof continuity: The introduced delta was inspected against the pinned merge base. Comparing the live-tested production revision with the final head shows only the added supervisor overlap test; production code is unchanged.
Producer and lifecycle ownership: Command execution and channel fallback pass the diagnostic owner returned by the deferred lifecycle manager. CLI execution registers the resolved allowance before awaiting execution, refreshes it from stdout, and releases it in finally.
Prior overlap finding resolved: Observations validate the exact owner generation and backend attempt; cleanup compares both identities before deleting the allowance. The new serialize:false regression finishes and closes the first call while asserting that the second retains its deadline.
Findings None None.
Security None None.

How this fits together

OpenClaw’s recovery watchdog uses runtime activity to decide when to cancel stalled agent turns. CLI execution supplies that activity, and the reply lifecycle owns delivery and final cleanup.

flowchart TD
  A[Incoming agent turn] --> B[CLI lifecycle owner]
  B --> C[Backend execution and output]
  C --> D[Owned activity and quiet deadline]
  D --> E[Recovery watchdog]
  E --> F[Continue healthy work or cancel stalled work]
  C --> G[Committed answer]
  G --> H[Bounded delivery finalization]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +254, Tests +769. Total +1023 across 29 files.

View PR surface stats
Area Files Added Removed Net
Source 20 754 500 +254
Tests 9 1921 1152 +769
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 29 2675 1652 +1023

Review metrics

Metric Value Why it matters
Production versus test growth Production net +254; tests/support net +769, with moves cancelling out Production growth supplies exact-attempt observation and revocation plus finalization protection, while reusing the existing owner registry.

Root-cause cluster

Relationship: canonical
Canonical: #138280
Summary: This PR continues the closed-unmerged CLI repair; the linked direct-provider heartbeat report describes a distinct completion problem.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep one lifecycle-owned recovery path that respects existing backend limits and delivery leases without adding another registry or operator setting.

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

Yes: current main exposes the missing CLI progress publication, and the supplied baseline run shows recovery interrupting continuing output. This review did not execute a new current-main reproduction.

Is this the best way to solve the issue?

Yes: the patch repairs missing facts at the executing owner and reuses existing recovery and finalization machinery. A global timeout increase or session-key deadline table would leave ownership and cleanup races unresolved.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 723731b5f7ad.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The supplied live observations exercise the changed CLI owner through Telegram Test Server and a built Gateway, showing complete long-turn delivery plus silent expiry, cancellation/replacement, and held finalization; the final commit changes only the overlap test.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove merge-risk: 🚨 availability: Current PR review selected no merge-risk labels.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P1: The current CLI recovery gap can interrupt healthy long turns and prevent their answers from reaching users.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The supplied live observations exercise the changed CLI owner through Telegram Test Server and a built Gateway, showing complete long-turn delivery plus silent expiry, cancellation/replacement, and held finalization; the final commit changes only the overlap test.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied live observations exercise the changed CLI owner through Telegram Test Server and a built Gateway, showing complete long-turn delivery plus silent expiry, cancellation/replacement, and held finalization; the final commit changes only the overlap test.

Evidence

What I checked:

  • Pinned change and proof continuity: The introduced delta was inspected against the pinned merge base. Comparing the live-tested production revision with the final head shows only the added supervisor overlap test; production code is unchanged. (src/agents/cli-runner/execute.supervisor-capture.test.ts:388, ff1b4ffd5783)
  • Producer and lifecycle ownership: Command execution and channel fallback pass the diagnostic owner returned by the deferred lifecycle manager. CLI execution registers the resolved allowance before awaiting execution, refreshes it from stdout, and releases it in finally. (src/agents/cli-runner/execute-process.ts:208, ff1b4ffd5783)
  • Prior overlap finding resolved: Observations validate the exact owner generation and backend attempt; cleanup compares both identities before deleting the allowance. The new serialize:false regression finishes and closes the first call while asserting that the second retains its deadline. (src/logging/diagnostic-run-activity.ts:194, ff1b4ffd5783)
  • Finalization remains bounded: Recovery recognizes committed outcomes without cancelling delivery. The existing finalization lease still expires stalled finalization; integration coverage verifies queued work remains blocked until that lease expires and then runs once. (src/logging/diagnostic-stuck-session-recovery.integration.test.ts:711, ff1b4ffd5783)
  • Current main still needs the repair: At the fetched main revision, stdout is counted and parsed without publishing recovery progress or an owned backend allowance. Its execution module matches the PR base blob, so this remains distinct useful work. (src/agents/cli-runner/execute-process.ts:147, 723731b5f7ad)
  • Release context: The latest supplied release, v2026.9.1, has the earlier recovery snapshot and stale-threshold contract without an owned backend quiet deadline. No shipped fixing implementation was established. (src/logging/diagnostic-run-activity-snapshot.ts, ad6fe23aecb9)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-04T13:36:28.231Z sha 29472188749e67939039d0333a1c164a45e69446 :: blocked before merge. :: [P1] Publish the CLI quiet deadline before waiting for stdout
  • reviewed 2026-09-04T13:57:12.116Z sha 29472188749e67939039d0333a1c164a45e69446 :: blocked before merge. :: [P1] Publish the CLI quiet deadline before waiting for stdout
  • reviewed 2026-09-04T16:40:57.808Z sha 1f90915 :: blocked before merge. :: [P1] Publish the CLI quiet deadline before waiting for stdout
  • reviewed 2026-09-04T17:01:43.928Z sha ce1fcc1 :: blocked before merge. :: [P1] Key liveness deadlines by run before clearing

sylvesterkaczmarek

This comment was marked as spam.

A CLI-backed agent turn that ran longer than ~6 minutes could be killed by
stuck-session recovery while it was still streaming, and its completed reply
was then never delivered to the channel.

Three producer-side gaps, all in how liveness facts reach the watchdog:

- The CLI backend counted stdout bytes for its own no-output watchdog but
  never published them as diagnostic run progress, so the freshness clock only
  advanced at tool boundaries. The core runtime already publishes per-chunk
  stream progress; the two implementations are now one shared reporter, and
  every CLI backend publishes through it.
- The CLI backend never published its resolved no-output deadline, so the
  generic 360s model-call floor preempted a backend allowance the operator had
  already configured. That deadline now rides `model.call.started` as
  `requestTimeoutMs` and bounds the generic floor, matching the direct
  provider path.
- Stale-expiry recovery ignored the `freezeAbort()` completion-wins seam that
  `supersede()` honors, so it could abort a turn whose terminal outcome was
  already committed and only delivery remained. Recovery now reports
  `keep_lane / terminal_outcome_committed` and leaves that owner to the
  existing finalization lease.

No new configuration surface: `agents.defaults.timeoutSeconds` and the
backend's `reliability.watchdog` settings now govern this path.

Claude-Session: https://claude.ai/code/session_0122p4qSQzsjwFgYUCDNrwMK
…he turn

Stdout keeps flowing on the CLI protocol stream while a parsed tool is open.
Publishing that as model-stream progress would refresh the same clock
blocked-tool recovery reads, so a wedged tool could never age into its
15-minute window. Mirror the core sibling, where stream progress is only
observed on model response chunks: skip the progress mark while a parsed tool
owns the turn.

Claude-Session: https://claude.ai/code/session_0122p4qSQzsjwFgYUCDNrwMK
The deadline test drove markDiagnosticModelStartedForTest, which passes
coreRequestForTest and bypasses the active-owner gate that ordinary starts
hit, so it proved nothing about the production path. Drive the real trusted
event instead, and pin the companion case where an owner-bound attempt holds
the same session activity and an ownerless deadline is dropped.

Claude-Session: https://claude.ai/code/session_0122p4qSQzsjwFgYUCDNrwMK
The no-output deadline rode claude-cli's model-call diagnostics, and that
factory returns for every other backend id, so a supported non-Claude CLI
backend published no allowance and its configured quiet window could still be
preempted by the generic 360s recovery floor.

Carry the deadline on the stream-progress update every CLI backend already
reports, record it on the session activity, and let both the embedded-run and
model-call recovery predicates extend their floor to it. This replaces the
claude-cli-only requestTimeoutMs field on model.call.started, so the ownerless
start gate no longer gates the allowance either.

Claude-Session: https://claude.ai/code/session_01VhcCrpA9PB6VWSWAkFoLgY
The deadline reaches recovery through the shared stream path rather than the
Claude-only model-call diagnostics, so pin that at the execution boundary with
a backend whose diagnostics helper never arms.

Claude-Session: https://claude.ai/code/session_01VhcCrpA9PB6VWSWAkFoLgY
The new CLI diagnostics cases enabled diagnostics process-wide, started run
activity tracking, then forced both off at teardown without draining the event
queue. The agents-support lane runs `--isolate=false`, so those globals and the
listener leaked into every later file in the same worker.

Restore the prior enabled value, drain queued events, and reset the event state
before handing the worker on.

Claude-Session: https://claude.ai/code/session_01VhcCrpA9PB6VWSWAkFoLgY
@anandnsharma
anandnsharma force-pushed the fix/cli-backend-stream-liveness-watchdog branch from 2947218 to 1f90915 Compare September 4, 2026 16:14
anand-thepasselgroup and others added 4 commits September 4, 2026 22:22
…s output

The allowance rode the stream-progress update, so it only reached recovery once
stdout arrived. A backend permitted to stay quiet for longer than the generic
360s floor could still be reclaimed before its first chunk - exactly the window
the allowance exists to cover.

Give the deadline its own owner, declared as the child starts and released when
that child settles, and read it in the recovery predicates. This also drops the
allowance off the run-activity record, so it no longer rides the progress clock
or depends on the ownerless model-call start being admitted.

Claude-Session: https://claude.ai/code/session_01VhcCrpA9PB6VWSWAkFoLgY
@obviyus

obviyus commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

Head: ff1b4ffd578370bcf10170f6f6f7d319dd34422d.

Both prior rank-up moves are addressed. Backend allowances now belong to the exact live owner, and the overlapping same-session serialize:false regression confirms that the first completion preserves the second allowance.

The updated PR body includes independent real Telegram red/green, silent-call expiry, cancellation/replacement, accepted-send finalization and native tool-path evidence. It also states the limits of the declined idle-timer probes. Exact-head CI and the independent landing review are running.

@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 5, 2026
@obviyus
obviyus merged commit f5fce6e into openclaw:main Sep 5, 2026
225 checks passed
@obviyus

obviyus commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Thanks @anandnsharma and @anand-thepasselgroup!

Landed in f5fce6e59e45dea4d559405814ba346044efecc7 from reviewed head ff1b4ffd578370bcf10170f6f6f7d319dd34422d. Exact-head CI passed, and the final native independent review reported no findings.

Proof: A real Telegram user turn through the native CLI kept producing text beyond the unchanged 360-second recovery threshold and delivered its full answer. Silent-call expiry, cancellation/replacement, accepted-send finalization and the native tool path also passed.

  • Bug: Recovery could interrupt a healthy CLI stream because its owner lacked current output progress and the backend's existing quiet allowance.
  • Fix: The exact live owner now holds both facts. A settling or stale attempt cannot clear its successor's allowance. Tool recovery and bounded finalization remain separate.
Before After
Recovery interrupted real output at 387 seconds, 245 ms after its last delta. The direct-CLI model completed at 556.7 seconds; Telegram received all 37 chunks by 626.6 seconds.

514 focused and sibling tests passed. The explicit overlapping-call regression failed with the baseline producer, then passed with the repair. The long-idle tool probes were declined and are not counted as passes; deterministic owner tests cover the separate tool timing policy.

This preserves the original work from #137372. The distinct direct-provider issue #137263 remains outside this repair.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 2026
Publish real CLI stream progress and the backend's existing quiet allowance through the exact current diagnostic owner. Release only the settling attempt, reject stale observations after closure or replacement, and keep active-tool recovery independent.

Preserve committed replies under the existing bounded finalization lease. Remove the separate session-ref deadline store and share the model stream-progress reporter.

Continue the contributor work from openclaw#137372. This does not claim to fix the distinct direct-provider issue openclaw#137263.

Co-authored-by: Anand Sharma <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
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: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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.

4 participants