Repository navigation
fix: stop sending the page URL with chat messages and never reject a request over its UI context - #10040
Merged
Conversation
…request over its UI context Since #9881 every chat message sent the full page URL (pathname, query and hash) as ui_page_path, and the server failed the whole request with InvalidArgument when it exceeded 2048 bytes. Explore and canvas URLs carry dashboard state and are allowed to grow to about 13 KB, so an IN filter with roughly 75 values was enough to make chat unusable on that page. The query string also shipped filter values to the LLM for no benefit. The page path was only ever a label in the system message that lists the clickable UI actions. Both agents already know what the user is viewing from their own context (the analyst context carries the explore or canvas name plus filters, dimensions, measures and time range; the developer context carries the current file), so the path is dropped entirely: the client no longer sends ui_page_path, the server ignores it, and UIContext only carries the actions. The proto field is kept for wire compatibility. The remaining UI context is optional, best-effort metadata for the click_ui tool, so uiContextFromPB now truncates oversized labels and drops malformed actions instead of returning an error. The label limit counts characters rather than bytes, matching the browser's truncation, so non-ASCII labels no longer fail the request either.
AdityaHegde
requested changes
Oct 20, 2026
AdityaHegde
left a comment
Collaborator
There was a problem hiding this comment.
- We would need some kind of priority instead of a hard 100 limit. Definitely needs a follow up.
- Right now, we would need some kind of signal to know the 100 limit is reached. Issue will get hidden if sometime down the line we hit the limit and new actions are not sent to agent.
- Lets add
deprecatedtoui_page_pathparams in proto.
…tion, log dropped actions, deprecate ui_page_path - Truncate labels by code point in the browser. String.slice counts UTF-16 code units and can split an emoji into a lone surrogate, which protojson rejects, so the whole chat request failed with a 400. - Validate actions before applying the 100 cap so malformed entries cannot crowd out valid ones, and log a warning whenever actions are dropped so a page that outgrows the cap is noticed. - Mark ui_page_path as deprecated in the proto and regenerate the affected bindings.
Collaborator
Author
|
Addressed in 005f0c9:
|
…-page-url # Conflicts: # proto/gen/rill/runtime/v1/api.pb.go
AdityaHegde
approved these changes
Oct 21, 2026
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.
Since #9881 every chat message sent the full page URL as
ui_page_path, and the server failed the whole request withInvalidArgumentwhen it exceeded 2048 bytes. Explore and canvas URLs carry dashboard state and are allowed to grow to about 13 KB, so anINfilter with roughly 75 values made chat unusable on that page. The query string also shipped filter values to the LLM for no benefit.ui_page_path, the server ignores it, andUIContextonly carries the actions. The proto field stays for wire compatibility.uiContextFromPBnow truncates oversized labels and drops malformed actions instead of returning an error; the UI context is best-effort metadata forclick_uiand should never fail a chat request.Steps to reproduce (before the fix):
INfilter with about 100 values, untillocation.href.lengthis over 2048.invalid UI context: ui_page_path exceeds 2048 bytes.Checklist: