LCORE-2311: Streaming query agent stream events#1870
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
c7304fd to
69353a8
Compare
1932d18 to
b7ebcaa
Compare
| # Skip the first token (shield status message) | ||
| if first_token: | ||
| first_token = False | ||
| continue |
There was a problem hiding this comment.
Removed workaround from old Agents API that was introduced for Responses API
First token is no longer a shield status nor an empty token but a real token.
5fc1a76 to
4a18cb8
Compare
4a18cb8 to
d798fd8
Compare
| turn_summary, | ||
| background_topic_summary_tasks=_background_topic_summary_tasks, | ||
| emit_start=False, | ||
| compacted=compacted, |
There was a problem hiding this comment.
Originally used for persistence of compacted turn. This has to be done differently and will be addressed in a separate PR.
|
|
||
| async def _responses_create(**kwargs: Any) -> Any: | ||
| if kwargs.get("stream", True): | ||
| return _mock_stream() |
There was a problem hiding this comment.
Client mock will be used only for vector_io operations, inference will be extracted to agent mock.
| assert call_kwargs["query"] == "What is OpenShift?" | ||
|
|
||
| # Verify RAG context was injected into the agent prompt | ||
| await _collect_sse_events(response) |
There was a problem hiding this comment.
Has to be manually iterated because run_stream_events is an async context manager, not as a plain async function.
Description
Wires agent streaming response into streaming query flow.
Type of change
Tools used to create PR
Identify any AI code assistants used in this PR (for transparency and review context)
Related Tickets & Documents
Checklist before requesting a review
Testing