Skip to content

fix: fire response complete on empty responses#9215

Merged
ugur-vaadin merged 2 commits intomainfrom
fix-fire-response-complete-on-empty-turns
Apr 30, 2026
Merged

fix: fire response complete on empty responses#9215
ugur-vaadin merged 2 commits intomainfrom
fix-fire-response-complete-on-empty-turns

Conversation

@ugur-vaadin
Copy link
Copy Markdown
Contributor

Description

A turn that produces no visible text — typically a tool-only turn where the model emits tool calls and stops without commentary — is still a successful exchange. But the response-complete lifecycle hooks were skipped: both the application-facing ResponseCompleteListener.onResponseComplete and the controller-facing AIController.onResponseComplete were gated behind a non-empty-text check. Controllers that flush their pending UI state in onResponseComplete (e.g. ChartAIController applying its pending query) never render on these turns; application listeners miss the completion entirely.

This PR moves both hook invocations out of the non-empty-text gate so every successful exchange fires them, with the firing cadence unchanged (still once per user prompt, not per tool call or round-trip). The conversationHistory add stays gated to avoid polluting history with empty assistant entries.

Type of change

  • Bugfix
  • Feature

Checklist

  • I have read the contribution guide: https://vaadin.com/docs/latest/contributing/overview
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.

@ugur-vaadin ugur-vaadin requested a review from tomivirkki April 29, 2026 05:00
@ugur-vaadin ugur-vaadin force-pushed the fix-fire-response-complete-on-empty-turns branch from b3f6166 to 6109515 Compare April 30, 2026 10:45
@ugur-vaadin ugur-vaadin enabled auto-merge April 30, 2026 10:45
@sonarqubecloud
Copy link
Copy Markdown

@ugur-vaadin ugur-vaadin added this pull request to the merge queue Apr 30, 2026
Merged via the queue into main with commit 4909765 Apr 30, 2026
9 checks passed
@ugur-vaadin ugur-vaadin deleted the fix-fire-response-complete-on-empty-turns branch April 30, 2026 11:12
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