Skip to content

fix(seer): Parse widget conditions into structured filters for LLM context#112445

Draft
Mihir-Mavalankar wants to merge 2 commits intomasterfrom
mihir-mavalankar/fix/structured-llm-conditions
Draft

fix(seer): Parse widget conditions into structured filters for LLM context#112445
Mihir-Mavalankar wants to merge 2 commits intomasterfrom
mihir-mavalankar/fix/structured-llm-conditions

Conversation

@Mihir-Mavalankar
Copy link
Copy Markdown
Contributor

@Mihir-Mavalankar Mihir-Mavalankar commented Apr 8, 2026

  • The raw Sentry search syntax in widget conditions (e.g. span.name:Containsqueue.task.taskworker) was passed directly into the LLM context tree. The Seer Explorer agent couldn't distinguish operators from values, causing it to misinterpret filters and make broken tool calls that returned no results.

+Add getSearchFiltersForLLM() in widgetLLMContext.tsx that wraps parseSearch to convert raw conditions into structured {field, op, value} objects with human-readable operators (via OP_LABELS) and negation support. Falls back to the raw string if parsing fails.

  Before:
  "conditions": "span.description:Contains[task1,task2] span.name:Containsqueue.task.taskworker !trigger_path:Containsold_seer_automation"

  After:
  "conditions": [
    {"field": "span.description", "op": "contains", "value": "[task1,task2]"},
    {"field": "span.name", "op": "contains", "value": "queue.task.taskworker"},
    {"field": "trigger_path", "op": "NOT contains", "value": "old_seer_automation"}
  ]

Mihir-Mavalankar and others added 2 commits April 7, 2026 18:55
The raw Sentry search syntax (e.g. Containsqueue.task.taskworker) was
passed directly to the LLM context, causing the Seer agent to
misinterpret operators as literal values and make broken tool calls.
Parse conditions via parseSearch and map operators through OP_LABELS
so the LLM sees structured {field, op, value} objects instead.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Verify parsing of an actual dashboard widget conditions string with
Contains IN list, single Contains, and negated Contains filters.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@Mihir-Mavalankar Mihir-Mavalankar self-assigned this Apr 8, 2026
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 8, 2026
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.

1 participant