Skip to content

OLS-2964: Emit AG-UI events from chat backend#23

Open
onmete wants to merge 2 commits into
openshift:mainfrom
onmete:ols-2964-ag-ui-chat
Open

OLS-2964: Emit AG-UI events from chat backend#23
onmete wants to merge 2 commits into
openshift:mainfrom
onmete:ols-2964-ag-ui-chat

Conversation

@onmete
Copy link
Copy Markdown
Contributor

@onmete onmete commented Apr 30, 2026

Summary

Implements OLS-2964: replace custom SSE event: types with AG-UI protocol events (data: JSON with type discriminator) using ag-ui-protocol (ag_ui.core + EventEncoder).

Scope

  • chat route: RUN_STARTED / RUN_FINISHED / RUN_ERROR; assistant text (TEXT_MESSAGE_*); full reasoning lifecycle; tool call correlation via generated toolCallId; CUSTOM + name: ui_component for ui:type fences.
  • Dependency: ag-ui-protocol>=0.1.18 (core runtime dependency).
  • Spec: .ai/spec/chat-api.md updated for AG-UI.
  • Konflux: uv.lock + requirements.*.txt regenerated.

Breaking change

Clients must parse AG-UI type from each data: line (no named SSE event: field). Coordinate with console (OLS-2965).

Verification

make verify and make test pass locally.


Epic: OLS-2963

Made with Cursor

Replace custom SSE event names with AG-UI JSON events via ag-ui-protocol:
RunStarted/Finished/Error, text and reasoning lifecycles, tool calls, and
CUSTOM ui_component for ui:type fences. Conversation UUID maps to threadId.

Updates chat-api spec and hashed requirements for Konflux.

Made-with: Cursor
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 30, 2026

@onmete: This pull request references OLS-2964 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

Implements OLS-2964: replace custom SSE event: types with AG-UI protocol events (data: JSON with type discriminator) using ag-ui-protocol (ag_ui.core + EventEncoder).

Scope

  • chat route: RUN_STARTED / RUN_FINISHED / RUN_ERROR; assistant text (TEXT_MESSAGE_*); full reasoning lifecycle; tool call correlation via generated toolCallId; CUSTOM + name: ui_component for ui:type fences.
  • Dependency: ag-ui-protocol>=0.1.18 (core runtime dependency).
  • Spec: .ai/spec/chat-api.md updated for AG-UI.
  • Konflux: uv.lock + requirements.*.txt regenerated.

Breaking change

Clients must parse AG-UI type from each data: line (no named SSE event: field). Coordinate with console (OLS-2965).

Verification

make verify and make test pass locally.


Epic: OLS-2963

Made with Cursor

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 30, 2026
@onmete
Copy link
Copy Markdown
Contributor Author

onmete commented Apr 30, 2026

AI self-review (round 1)

Verdict: Pass — implementation matches the approved plan and AC.

Checks: make verify (ruff + mypy) and make test pass.

Notes:

  • AG-UI lifecycle and tool correlation align with OLS-2964 plan (including full reasoning sequence).
  • Breaking wire change: consumers must read type from each data: JSON payload (coordinate with OLS-2965).

AI-generated via lightspeed-team-harness: https://github.com/openshift/lightspeed-team-harness

@openshift-ci openshift-ci Bot requested review from harche and xrajesh April 30, 2026 11:46
Add 8 tests for error/timeout terminal events, tool call ID
correlation, text message lifecycle, reasoning ordering,
content_block_stop closing reasoning, partial fences, malformed
JSON, and unclosed fence flush. Add pytest-cov to dev deps.

chat.py coverage: 87% → 94%.

Made-with: Cursor
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 30, 2026

@onmete: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@onmete
Copy link
Copy Markdown
Contributor Author

onmete commented May 11, 2026

/hold
rebase after #24

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants