Skip to content

ref(seer): Filter LLM context to widget-builder on builder routes#113623

Merged
Mihir-Mavalankar merged 2 commits into
masterfrom
mihir-mavalankar/ref/filter-llm-context-widget-builder-routes
Apr 22, 2026
Merged

ref(seer): Filter LLM context to widget-builder on builder routes#113623
Mihir-Mavalankar merged 2 commits into
masterfrom
mihir-mavalankar/ref/filter-llm-context-widget-builder-routes

Conversation

@Mihir-Mavalankar

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

Copy link
Copy Markdown
Contributor
  • When the widget builder is open, both the dashboard and widget-builder register as root-level LLM context nodes. The full dashboard tree is noise on widget builder pages. Filter the snapshot to only include widget-builder nodes on widget builder routes so the Seer agent receives only the relevant context.
  • Also adds dashboard details to the widgetbuilder context.

@Mihir-Mavalankar Mihir-Mavalankar self-assigned this Apr 21, 2026
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 21, 2026
@Mihir-Mavalankar
Mihir-Mavalankar marked this pull request as ready for review April 21, 2026 23:38
@Mihir-Mavalankar
Mihir-Mavalankar requested a review from a team as a code owner April 21, 2026 23:38
@Mihir-Mavalankar
Mihir-Mavalankar requested a review from a team as a code owner April 22, 2026 16:22
Mihir-Mavalankar and others added 2 commits April 22, 2026 09:41
When the widget builder is open, both the dashboard and widget-builder
register as root-level LLM context nodes. The full dashboard tree is
noise on widget builder pages. Filter the snapshot to only include
widget-builder nodes on widget builder routes so the Seer agent
receives only the relevant context.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Include dashboardTitle, dashboardWidgetCount, and dashboardFilters in
the widget-builder's useLLMContext data so the node is self-contained
when the snapshot is filtered on widget builder routes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Mihir-Mavalankar
Mihir-Mavalankar force-pushed the mihir-mavalankar/ref/filter-llm-context-widget-builder-routes branch from 6a38dbe to 179753c Compare April 22, 2026 16:43

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 179753c. Configure here.

Comment thread static/app/views/seerExplorer/hooks/useSeerExplorer.tsx

@gggritso gggritso left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👌

Comment on lines -400 to +413
screenshot = JSON.stringify(getLLMContext());
let snapshot = getLLMContext();
if (WIDGET_BUILDER_ROUTES.has(getPageReferrer())) {
snapshot = {
...snapshot,
nodes: snapshot.nodes.filter(n => n.nodeType === 'widget-builder'),
};
}
screenshot = JSON.stringify(snapshot);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It might make sense to have a mechanism to figure out node priority based on the node's properties (e.g., a priority property, or something similar) rather than using routes, but this makes sense in a pinch 👍

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah it's a bit hacky for sure. I'll think on this a bit and come back to it with some priority based system.

@Mihir-Mavalankar
Mihir-Mavalankar merged commit 65031c6 into master Apr 22, 2026
65 checks passed
@Mihir-Mavalankar
Mihir-Mavalankar deleted the mihir-mavalankar/ref/filter-llm-context-widget-builder-routes branch April 22, 2026 18:15
@github-actions github-actions Bot locked and limited conversation to collaborators May 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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