fix(gateway): preserve final delivery on non-editable streams - #58929
fix(gateway): preserve final delivery on non-editable streams#58929devatnull wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aligns proxy-mode streaming behavior with the existing direct-agent behavior for non-editable messaging adapters, preventing streaming “preview” deliveries that can’t be edited into a final message on platforms without message-edit support.
Changes:
- Skip gateway stream-consumer setup for adapters that don’t support message editing in the proxy streaming path.
- Add regression tests covering both direct and proxy execution paths to ensure non-editable adapters do not receive progressive streaming sends and that final delivery remains eligible to run once.
- Validate proxy SSE parsing still produces the correct assembled
final_responsewhile reportingresponse_previewed=Falsewhen previews are suppressed.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
gateway/run.py |
Disables proxy-path streaming previews on non-editable adapters so final delivery isn’t suppressed/duplicated. |
tests/gateway/test_run_progress_topics.py |
Adds direct + proxy regression coverage ensuring non-editable adapters do not receive streaming preview sends. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thanks for the focused proxy-path fix. Current The proposed guard matches the existing direct-agent behavior at Automated hermes-sweeper review. |
82b3ef0 to
20b1dff
Compare
Summary
Why
Non-editable messaging platforms cannot replace a stream preview with the final answer. If a preview is sent first, final delivery can be suppressed or duplicated. The direct agent path already guarded this; this PR applies the same guard to proxy-mode streaming and tests both paths.
Test plan
python3 -m pytest tests/gateway/test_run_progress_topics.py::test_proxy_non_editable_streaming_uses_final_delivery_only tests/gateway/test_run_progress_topics.py::test_run_agent_non_editable_streaming_uses_final_delivery_only -qscripts/run_tests.sh tests/gateway/test_run_progress_topics.py -qpython3 -m py_compile gateway/run.py tests/gateway/test_run_progress_topics.pygit diff --check origin/main...HEAD