Skip to content

fix(seer): Make widget conditions readable for the Seer Explorer agent #112502

Merged
Mihir-Mavalankar merged 3 commits intomasterfrom
mihir-mavalankar/fix/readable-llm-conditions
Apr 8, 2026
Merged

fix(seer): Make widget conditions readable for the Seer Explorer agent #112502
Mihir-Mavalankar merged 3 commits intomasterfrom
mihir-mavalankar/fix/readable-llm-conditions

Conversation

@Mihir-Mavalankar
Copy link
Copy Markdown
Contributor

  • Widget query conditions use internal \uf00d Unicode markers around wildcard operators (e.g. Contains, StartsWith), which produce garbled strings like Containsqueue.task.taskworker when rendered to markdown for the Seer agent — causing the agent to make broken tool calls with literal operator text as search values.
  • Add readableConditions() that replaces the 6 \uf00d-delimited operators with readable labels (e.g. contains, starts with) via simple string replacement. All other query structure — AND, OR, parentheses, free text, negation, comparison operators — passes through unchanged.
  • Update widget query hints to describe what each widget type visualizes (timeseries chart, table, single number) and direct the agent to understand intent from the query config, instead of referencing internal API parameters (y_axes, group_by) that the natural-language tool doesn't use.
  • Add 20 tests covering all 6 operator types, partial match safety, mixed operators, repeated operators, OR with parens, free text passthrough, literal "Contains" without markers, and a real-world dashboard widget query.

… LLM context

Widget conditions use \uf00d-delimited operators (e.g. Containsqueue.task)
that are invisible but garble the Seer agent's understanding, causing
broken tool calls. Replace these with readable labels (e.g. " contains ")
via simple string replacement that preserves all query structure — AND,
OR, parens, free text, and comparison operators pass through unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@example.com>
@Mihir-Mavalankar Mihir-Mavalankar self-assigned this Apr 8, 2026
@Mihir-Mavalankar Mihir-Mavalankar requested a review from a team as a code owner April 8, 2026 19:20
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 8, 2026
The Seer agent uses natural language tool calls, not raw API params.
Replace hints that reference internal params (y_axes, group_by, query)
with descriptions of what the widget visualizes and direct the agent
to understand the intent from the query config.

Co-Authored-By: Claude Opus 4.6 <noreply@example.com>
Copy link
Copy Markdown
Member

@gggritso gggritso left a comment

Choose a reason for hiding this comment

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

Makes sense 👍 I'll leave it to you if you want to make the query conversion more robust or not. I think if you don't cover all the cases now it'll be harder to spot the bad cases later, but up to you

Instead of hardcoding 6 replaceAll calls, derive replacements from
OP_LABELS by filtering to keys containing \uf00d markers. This
automatically handles any new operators added to the map.

Co-Authored-By: Claude Opus 4.6 <noreply@example.com>
@Mihir-Mavalankar Mihir-Mavalankar enabled auto-merge (squash) April 8, 2026 20:27
@Mihir-Mavalankar Mihir-Mavalankar merged commit 5ab68e5 into master Apr 8, 2026
65 checks passed
@Mihir-Mavalankar Mihir-Mavalankar deleted the mihir-mavalankar/fix/readable-llm-conditions branch April 8, 2026 20:34
george-sentry pushed a commit that referenced this pull request Apr 9, 2026
#112502)

+ Widget query conditions use internal \uf00d Unicode markers around
wildcard operators (e.g. Contains, StartsWith), which produce garbled
strings like Containsqueue.task.taskworker when rendered to markdown for
the Seer agent — causing the agent to make broken tool calls with
literal operator text as search values.
+ Add readableConditions() that replaces the 6 \uf00d-delimited
operators with readable labels (e.g. contains, starts with) via simple
string replacement. All other query structure — AND, OR, parentheses,
free text, negation, comparison operators — passes through unchanged.
+ Update widget query hints to describe what each widget type visualizes
(timeseries chart, table, single number) and direct the agent to
understand intent from the query config, instead of referencing internal
API parameters (y_axes, group_by) that the natural-language tool doesn't
use.
+ Add 20 tests covering all 6 operator types, partial match safety,
mixed operators, repeated operators, OR with parens, free text
passthrough, literal "Contains" without markers, and a real-world
dashboard widget query.

---------

Co-authored-by: Claude Opus 4.6 <noreply@example.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants