Skip to content

feat!: pass request event to AIController.onRequest - #10020

Merged
tomivirkki merged 2 commits into
mainfrom
feat/controller-request-event
Sep 7, 2026
Merged

feat!: pass request event to AIController.onRequest#10020
tomivirkki merged 2 commits into
mainfrom
feat/controller-request-event

Conversation

@tomivirkki

Copy link
Copy Markdown
Member

Description

  • Changed AIController.onRequest() to receive the RequestListener.RequestEvent of the turn, the same event the request listener gets, so a controller can read the user message, message id, and attachments
  • Made the RequestEvent constructor public so applications can unit test controller implementations; it copies the attachment list and rejects null arguments
  • Updated FormAIController and the field-marker test page to the new signature
  • Added tests for the shared event and its unmodifiable attachment list

Type of change

  • Feature

Warning

Breaking change: custom AIController implementations that override onRequest() must change the signature to onRequest(RequestListener.RequestEvent).

AIController.onRequest() now receives the same RequestListener.RequestEvent
as the request listener. Implementations must update their override to
onRequest(RequestListener.RequestEvent).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

@vaadin-review-bot vaadin-review-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the changes — left 1 comment.

Finding
📝 New public constructor omits the @throws NullPointerException tag its sibling documents

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Sep 7, 2026

Copy link
Copy Markdown

@tomivirkki
tomivirkki added this pull request to the merge queue Sep 7, 2026
Merged via the queue into main with commit b56291f Sep 7, 2026
22 checks passed
@tomivirkki
tomivirkki deleted the feat/controller-request-event branch September 7, 2026 13:39
tomivirkki added a commit that referenced this pull request Sep 7, 2026
…3) (#10043)

This PR cherry-picks changes from the original PR #10020 to branch 25.3.
---
#### Original PR description
> ## Description
> 
> - Changed `AIController.onRequest()` to receive the
`RequestListener.RequestEvent` of the turn, the same event the request
listener gets, so a controller can read the user message, message id,
and attachments
> - Made the `RequestEvent` constructor public so applications can unit
test controller implementations; it copies the attachment list and
rejects `null` arguments
> - Updated `FormAIController` and the field-marker test page to the new
signature
> - Added tests for the shared event and its unmodifiable attachment
list
> 
> ## Type of change
> 
> - Feature
> 
> > [!WARNING]
> > Breaking change: custom `AIController` implementations that override
`onRequest()` must change the signature to
`onRequest(RequestListener.RequestEvent)`.

Co-authored-by: Tomi Virkki <tomivirkki@users.noreply.github.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants