Files
openclaw/packages/agent-core
Peter Steinberger 83e24f8421 fix(llm-core): settle result() when a stream ends without a terminal event (#120508)
* fix(llm-core): settle result() when a stream ends without a terminal event

EventStream.end() with no argument and no prior terminal event left the final
result promise pending forever; any consumer awaiting result() dead-ended
silently for the whole run budget (the agent loop's fall-through in
streamAssistantResponse awaits exactly that promise). All in-repo pumps push
terminals or pass end(result), so this only fires on producer contract
violations — which previously hung and now reject loudly with a named error.
A pre-attached catch keeps iterate-only consumers free of unhandled
rejections. Also dedupe the agent loop's two identical final-message blocks
into one finalizeAssistantMessage helper (net-negative production delta).

Follow-up from #120426's turn-liveness investigation.

* fix(llm-core): void the intentional rejection pre-catch

ClawSweeper P1: the pre-attached no-op catch returns a Promise that would
float under typescript/no-floating-promises.
2026-08-08 13:07:58 -07:00
..