fix(c-generative-ui): tighten plan_tools — one tool per filter, not four#363
Merged
Conversation
…scope
"Filter to cancelled flights only" was calling all 4 tools (kpis +
trend + airlines + disruptions) and dumping the filtered result as
plaintext instead of letting the data_grid component re-render. The
per-turn plan_tools context just said "decide which tools to call" —
too permissive; gpt-5-mini defaults to refreshing everything.
Tighter rules now in the per-turn system context (not just the static
prompt file, which the model demonstrably ignores for tool-selection):
1) FILTER / SCOPE → exactly ONE tool, the one backing the affected
component, with new parameters. No spec regen.
2) STRUCTURAL → regen spec, then call only tools for NEW components.
3) QUESTION → no tools, no JSON, just prose.
Calling all four is now explicitly reserved for "refresh" / "reload" /
"update everything". Applied to both umbrella backend and standalone.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
3 tasks
blove
added a commit
that referenced
this pull request
May 16, 2026
…372) gpt-5-mini ignored the "EXACTLY ONE tool" directive added in PR #363 and kept calling all four data tools on every filter follow-up. Verified live: my prompt rewrite was strict and explicit ("call EXACTLY ONE tool", "Do NOT call the other tools") but gpt-5-mini still fanned out — the model's default reasoning prefers thoroughness over literal directive-following. Split the LLMs: - `_llm` (gpt-5-mini) — unchanged for shell-gen + respond. Cheap and good enough for prose + JSON-spec emission. - `_planner_llm` (gpt-5, reasoning_effort='minimal') — bound to tools, used in plan_tools. gpt-5 follows directives more precisely; reasoning_effort='minimal' suppresses the "let me be thorough" deliberation that drives the fan-out. Standalone smoke (separate from chrome): prompt: "Filter to cancelled flights only" result: ['query_recent_disruptions'] ← exactly one Chrome MCP end-to-end: backend log confirms AI tool_calls: ['query_recent_disruptions'], data grid updates to 3 cancelled rows. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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
"Filter to cancelled flights only" calls all 4 dashboard tools (kpis + trend + airlines + disruptions) and then dumps the filtered result as plaintext — visually nothing updates in the data_grid, the LLM hallucinates a workaround in prose. The per-turn
plan_toolssystem context just said "decide which tools to call" — too permissive;gpt-5-minidefaults to refreshing everything.Fix
Tighter rules in the per-turn system context (not just the static prompt file, which the model demonstrably ignores for tool-selection decisions):
Calling all four is now explicitly reserved for "refresh" / "reload" / "update everything".
Test plan
query_recent_disruptionsfires (withtype="cancelled"), data_grid updates to 3 rows, no spec regenFiles
cockpit/langgraph/streaming/python/src/dashboard_graph.py— rewriteplan_toolscontext (umbrella)cockpit/chat/generative-ui/python/src/graph.py— same rewrite in standalone copy🤖 Generated with Claude Code