Files
openclaw/packages
Peter Steinberger 5ebbc3c003 fix(agents): keep stalled turns visible after Responses streams settle (#120426)
* fix(agents): keep stalled turns visible after Responses streams settle

A bare-continue turn in live QA (goal-followthrough-live, gpt-5.4 via
openai-responses) completed its SSE requests and then produced no terminal
result, delivery, timeout, or error for 6+ minutes until SIGTERM. Root cause:
turn liveness is enforced only while awaiting provider stream events (llm-idle
watchdog); queued subscription handlers are fire-and-forget during the turn and
finalize joined them unbounded and un-abortable, backed only by the 48h default
run budget. One hung delivery handler silently dead-ended the whole turn.

- Bound the pending-events join in attempt-stream-finalize with a 120s liveness
  deadline plus the run-abort signal; on expiry, warn with the runId and proceed
  to settlement so the run always yields a visible terminal outcome.
- Responses transports now report every SSE event via notifyLlmRequestActivity
  (parity with completions/anthropic), so bookkeeping-only events keep the idle
  watchdog quiet instead of counting as network silence.

* fix(agents): bound the settlement block-reply flush with the shared liveness join

ClawSweeper P1 on #120426: after the finalize-phase join times out, settlement
still awaited onBlockReplyFlush on the same wedged delivery chain (unbounded on
the supported blockReplyTimeoutMs: 0 path). Generalize the bounded join into
joinWithRunLivenessDeadline in run/abortable.ts (owner of abort/liveness
racing) and use it for both the pending-events join and the settle flush;
timeout and abort resolve with a recorded warning so the turn always reaches a
visible terminal outcome. New coverage: helper tests (hang, abort, rejection)
and a real-settle-path regression holding the flush past the deadline.
2026-08-08 12:34:23 -07:00
..