Skip to content

fix(streaming): use finish_reason=length for partial stream stub#30988

Closed
ilonagaja509-glitch wants to merge 1 commit into
NousResearch:mainfrom
ilonagaja509-glitch:fix/30963-partial-stream-finish-reason
Closed

fix(streaming): use finish_reason=length for partial stream stub#30988
ilonagaja509-glitch wants to merge 1 commit into
NousResearch:mainfrom
ilonagaja509-glitch:fix/30963-partial-stream-finish-reason

Conversation

@ilonagaja509-glitch

Copy link
Copy Markdown
Contributor

Partial stream stub responses returned finish_reason=stop which caused the agent loop to exit prematurely even when budget remained.

The model had not legitimately finished — the connection dropped mid-stream. Changing to finish_reason=length triggers the continuation path in conversation_loop.py, allowing the agent to retry or continue working on the goal.

Fixes #30963

Partial stream stub responses were returning finish_reason=stop which
caused the agent loop to exit prematurely even when budget remained.
The model had not legitimately finished — the connection dropped mid-stream.

Changing to finish_reason=length triggers the continuation path in
conversation_loop.py, allowing the agent to retry or continue working
on the goal.

Fixes NousResearch#30963
@alt-glitch alt-glitch added type/bug Something isn't working P1 High — major feature broken, no workaround comp/agent Core agent loop, run_agent.py, prompt builder labels May 23, 2026
@ilonagaja509-glitch

Copy link
Copy Markdown
Contributor Author

Closing in favor of #30998 which also adds the truthful continuation prompt for network-error cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder P1 High — major feature broken, no workaround type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Partial Stream Misclassified as Clean Completion Causes Premature Loop Exit

2 participants