Skip to content

fix(gateway): stream synthesized recovery finals - #31475

Closed
BROCCOLO1D wants to merge 1 commit into
NousResearch:mainfrom
BROCCOLO1D:fix/31449-recovery-stream-deltas
Closed

fix(gateway): stream synthesized recovery finals#31475
BROCCOLO1D wants to merge 1 commit into
NousResearch:mainfrom
BROCCOLO1D:fix/31449-recovery-stream-deltas

Conversation

@BROCCOLO1D

Copy link
Copy Markdown
Contributor

Summary

Why

  • partial_stream_recovery and fallback_prior_turn_content assign final_response from local recovery text and then break without another model delta.
  • SSE/Open WebUI-style clients can otherwise receive only a finish chunk and render a blank bubble even though Hermes has a final answer.

Changes

  • agent/conversation_loop.py: adds a small helper for synthesized final deltas and uses it for guardrail halt, partial stream recovery, and prior-turn fallback finals.
  • tests/run_agent/test_run_agent.py: asserts partial-stream recovery and prior-turn fallback text is emitted to stream consumers.

Validation

  • python -m ruff check agent/conversation_loop.py tests/run_agent/test_run_agent.py
  • python -m pytest tests/run_agent/test_tool_call_guardrail_runtime.py tests/run_agent/test_run_agent.py::TestRunConversation::test_partial_stream_recovery_on_empty_stub tests/run_agent/test_run_agent.py::TestRunConversation::test_prior_turn_fallback_emits_stream_delta -o 'addopts=' -q

Scope

  • In scope: final text synthesized by recovery/guardrail paths that would otherwise bypass stream deltas.
  • Out of scope: changing retry policy, recovery selection, or the broader SSE protocol.

@BROCCOLO1D

Copy link
Copy Markdown
Contributor Author

Superseded by a replacement PR with the same diff and corrected GitHub noreply author attribution.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants