fix(gateway): call post-turn goal continuation on streaming path to prevent dead /goal loop (#62202) - #62235
fix(gateway): call post-turn goal continuation on streaming path to prevent dead /goal loop (#62202)#62235webtecnica wants to merge 1 commit into
Conversation
…revent dead /goal loop (NousResearch#62202)
Duplicate of #54222, which fixes the same bug (goal judge never fires on the streaming path in |
|
Traced this on current main and the diagnosis is correct: the streaming/ Three things before this is mergeable, all mirroring the existing hook at 10302:
Happy to re-check once updated; the underlying fix is worth landing. |
|
Thanks for tracing the streamed-response gap; current Problems
Suggested changes
Automated hermes-sweeper review. |
Re: the @teknium1's |
Re-anchoring the duplicate link: the canonical fix is #54222 (created 2026-06-28, still open) which patches the same streaming |
|
Closing as duplicate — another PR already addressed this. Appreciate the contribution! |
Summary
The gateway's
/goalloop was effectively dead because_post_turn_goal_continuation()was never called after streaming responses. The goal judge never fired,turns_usedstayed at 0, and users reported the goal system did nothing despite correct configuration.Root Cause
_handle_message_with_agent()returnsNonewhen streaming already delivered the response (already_sent=True). The caller at_handle_messagelevel only calls_post_turn_goal_continuation()after a non-None response, so the streaming path entirely skipped goal evaluation.Change
Added a goal continuation call inside
_handle_message_with_agent()before the streamingreturn Nonepath, mirroring the non-streaming path's logic. The streaming path now evaluates the goal judge after every turn.Verification
9 goal-related tests pass, 1 skipped.