Repository navigation
feat: expose per-turn session metadata to the LLM - #9399
Merged
Merged
Conversation
Without dynamic context, an LLM has no way to interpret relative
date/time references ("show me sales from the past two months") — it
guesses the date. The new AIOrchestrator.Builder#withContext accepts a
free-form supplier that the orchestrator invokes once per turn on the UI
thread; the resolved string is exposed to the LLM as the description of
a built-in get_session_context tool so it is available without a tool
call. The orchestrator installs a default supplier that renders the
current date/time; applications can compose richer context (tenant,
locale, page state) without touching the system prompt.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ugur-vaadin
approved these changes
Jun 1, 2026
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
tomivirkki
enabled auto-merge
June 1, 2026 14:01
|
tomivirkki
added a commit
that referenced
this pull request
Jun 2, 2026
…9410) This PR cherry-picks changes from the original PR #9399 to branch 25.2. --- #### Original PR description > ## Summary > - The LLM needs ambient session context — current date/time, and optionally tenant, locale, or view state — to interpret relative references like "sales from the past two months" instead of guessing. Putting that in the system prompt would invalidate its cache every turn, so it rides on a built-in get_session_context tool whose description carries the content, keeping the (potentially large) system prompt cacheable. > - The orchestrator installs a default supplier that provides the current server date and time; withMetadata lets apps replace or extend it with their own context, or pass null to disable the tool entirely. > > Closes https://github.com/orgs/vaadin/projects/103/views/3?pane=issue&itemId=193058102 > > 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Tomi Virkki <tomivirkki@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collaborator
|
This ticket/PR has been released with Vaadin 25.3.0. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Closes https://github.com/orgs/vaadin/projects/103/views/3?pane=issue&itemId=193058102
🤖 Generated with Claude Code