fix(workflow): render agent tool chip names from static sources, not stored title#5501
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
@cursor review |
PR SummaryLow Risk Overview Panel tool chips ( Canvas block summaries and workflow search/replace pass the same hydration ( Tests in Reviewed by Cursor Bugbot for commit d76e45d. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThis PR fixes a UI bug where copilot
Confidence Score: 5/5Safe to merge — the change is a read-only display fix that never mutates stored workflow state, and all three affected render surfaces now agree on canonical tool names. The resolver logic is correct and consistent across panel chips, canvas summaries, and the search index. MCP tool ID keying uses createMcpToolId uniformly. The workflow/workflow_input block types are covered via the block registry. Custom-block overlay invalidation is wired through customBlockOverlayVersion in all relevant memos. Tests pin every resolution branch and verify that mutated stored titles are excluded from the search index. No state is written, no API contracts are changed. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Stored Tool Entry] --> B{resolveStoredToolName}
B --> C{custom-tool?}
C -- yes --> D{customToolId string?}
D -- yes --> E[Look up customTools records]
E --> F{record found?}
F -- yes --> G[record.title or schema name]
F -- no --> H[storedTitle or schemaName]
D -- no --> H
C -- no --> I{mcp?}
I -- yes --> J{toolId string?}
J -- yes --> K[Look up mcpToolNamesById]
K --> L{live name found?}
L -- yes --> M[live MCP name]
L -- no --> N[storedTitle fallback]
J -- no --> N
I -- no --> O{type string present?}
O -- yes --> P[getBlockConfig via registry + overlay]
P --> Q{blockConfig.name?}
Q -- yes --> R[canonical block name]
Q -- no --> S[storedTitle or raw type id]
O -- no --> T[storedTitle or schemaName or null]
subgraph Consumers
U[Panel chips]
V[Canvas summary]
W[Search index]
end
B --> Consumers
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[Stored Tool Entry] --> B{resolveStoredToolName}
B --> C{custom-tool?}
C -- yes --> D{customToolId string?}
D -- yes --> E[Look up customTools records]
E --> F{record found?}
F -- yes --> G[record.title or schema name]
F -- no --> H[storedTitle or schemaName]
D -- no --> H
C -- no --> I{mcp?}
I -- yes --> J{toolId string?}
J -- yes --> K[Look up mcpToolNamesById]
K --> L{live name found?}
L -- yes --> M[live MCP name]
L -- no --> N[storedTitle fallback]
J -- no --> N
I -- no --> O{type string present?}
O -- yes --> P[getBlockConfig via registry + overlay]
P --> Q{blockConfig.name?}
Q -- yes --> R[canonical block name]
Q -- no --> S[storedTitle or raw type id]
O -- no --> T[storedTitle or schemaName or null]
subgraph Consumers
U[Panel chips]
V[Canvas summary]
W[Search index]
end
B --> Consumers
Reviews (8): Last reviewed commit: "fix(workflow): recompute search index wh..." | Re-trigger Greptile |
Greptile SummaryThis PR hardens tool chip display names in agent blocks against copilot state edits by sourcing them from static/canonical registries instead of the workflow JSON's mutable
Confidence Score: 3/5Safe to merge for integration and custom tools; the canvas summary path for workflow-as-tool entries remains unprotected against title edits. The two render paths diverge for apps/sim/lib/workflows/subblocks/display.ts — the Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Tool entry in workflow state] --> B{tool.type?}
B -->|custom-tool| C[Look up custom-tool record by customToolId]
C --> C1{Record found?}
C1 -->|Yes| C2[Use record.title]
C1 -->|No| C3[Fall back to stored tool.title]
B -->|mcp| D[Look up live MCP tool by toolId]
D --> D1{Live data available?}
D1 -->|Yes| D2[Use mcpTool.name]
D1 -->|No| D3[Fall back to stored tool.title]
B -->|workflow| E[tool-input.tsx: static Workflow]
E -.->|display.ts gap| F[resolveToolsLabel: still reads stored t.title]
B -->|integration type| G[getBlock type from registry]
G --> G1{Block found?}
G1 -->|Yes| G2[Use blockConfig.name]
G1 -->|No| G3[Use raw tool.type]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[Tool entry in workflow state] --> B{tool.type?}
B -->|custom-tool| C[Look up custom-tool record by customToolId]
C --> C1{Record found?}
C1 -->|Yes| C2[Use record.title]
C1 -->|No| C3[Fall back to stored tool.title]
B -->|mcp| D[Look up live MCP tool by toolId]
D --> D1{Live data available?}
D1 -->|Yes| D2[Use mcpTool.name]
D1 -->|No| D3[Fall back to stored tool.title]
B -->|workflow| E[tool-input.tsx: static Workflow]
E -.->|display.ts gap| F[resolveToolsLabel: still reads stored t.title]
B -->|integration type| G[getBlock type from registry]
G --> G1{Block found?}
G1 -->|Yes| G2[Use blockConfig.name]
G1 -->|No| G3[Use raw tool.type]
Reviews (2): Last reviewed commit: "fix(workflow): render agent tool chip na..." | Re-trigger Greptile |
09cae9a to
61b81a4
Compare
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 61b81a4. Configure here.
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
|
@cursor review |
|
@cursor review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 50df1e6. Configure here.
50df1e6 to
1278bce
Compare
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 1278bce. Configure here.
…stored title Tool entries in an agent block's inputs carry a mutable `title` in workflow state, which copilot edits (edit_workflow) could rewrite to change what the UI displays. Derive chip names from static/canonical sources instead: the block registry name for integration tools (raw type id if unregistered), the custom-tool record over the stored snapshot, the live MCP tool name, and a static literal for workflow-as-tool. The stored `title` still persists in state; the UI just no longer reads it for registry-backed tools. Covers both render paths: the expanded tool-input chips and the collapsed canvas summary (resolveToolsLabel, also used by workflow preview). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…atic naming Address review findings: resolveToolsLabel now returns the static 'Workflow' label for workflow/workflow_input entries instead of falling through to the stored title, matching the panel chip; the panel's custom-tool name priority now matches resolveToolsLabel (record title, record schema function name, then stored title); and the display-name comment no longer overstates the guarantee. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The panel resolved integration tool names through toolBlocks, which is permission- and toolbar-filtered, so a stored tool whose type was filtered out of the picker fell back to the raw type id while the canvas summary (getBlock) still showed the registry name. Use getBlock directly for the display name so both paths agree; toolBlocks still drives the chip icon, params, and picker. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… summaries resolveToolsLabel preferred the stored title for mcp entries, so canvas and preview summaries could show a state-edited name while the config panel showed the live MCP tool name. Accept an optional mcpTools list (matched by toolId, same as the panel) and pass the already-fetched MCP tool data from workflow-block; the stored title remains the fallback while server data is unavailable. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…llback, and search regressions Consolidate the per-surface name logic into one resolveStoredToolName in display.ts (canonical source -> stored title -> raw type id) used by the panel chips, the canvas summary, and the search indexer, fixing the regressions the per-renderer patches introduced: - custom-block tools (async registry overlay) no longer render raw custom_block_<uuid> ids pre-hydration or after deletion; the canvas memo and panel picker now subscribe to the overlay version so labels recompute when custom blocks hydrate - unresolvable block types fall back to the stored title before the raw type id, instead of always showing the id - the search indexer now indexes the resolved display name (the title entry was already read-only), so search text and highlights match what the chips render instead of the mutable stored title - redundant hardcoded 'Workflow' labels removed (registry names cover workflow/workflow_input); MCP lookups use a shared Map keyed by composite tool id instead of per-entry array scans; panel chip chrome falls back to the unfiltered registry for picker-hidden types Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…r; fix blockConfigs type The search index now resolves tool names with the same data as the chip renderers: the single caller passes customTools and a live MCP name map into indexWorkflowSearchMatches, so indexed names match the panel for custom-tool references and MCP entries, not just registry-backed types. Also declare the optional name on WorkflowSearchIndexerOptions blockConfigs entries, fixing the next build type error. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ydrates The matches memo resolves tool names through getBlock, so it must carry the overlay version dep like the other getBlock-derived memos; without it, find-in-workflow could index stale custom-block names until an unrelated dep changed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1278bce to
d76e45d
Compare
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit d76e45d. Configure here.
Renders agent tool chip names from canonical sources (block registry, custom-tool records, live MCP data) instead of the mutable
titlefield in workflow JSON state, so copilotedit_workflowoperations (or any direct state edit) can no longer change what the workflow UI displays for a tool. One shared resolver (resolveStoredToolName) drives the panel chips, the collapsed canvas summaries, and the workflow search index, so all surfaces agree. Resolution order: canonical name → stored title (only when nothing resolves: deleted custom blocks, MCP data not yet loaded, legacy inline custom tools) → raw type id.Type of Change
Testing
display.test.ts(registry-backed entries ignore edited titles; workflow/workflow_input resolve statically; unresolvable types fall back to stored title then raw id; custom-tool record and live MCP name win over stored title) andindexer.test.ts(search indexes the resolved display name, not the mutated title; canonical MCP/custom-tool names indexed when live data is present) — 119 tests passing across the affected suites.tsc --noEmitclean,biome checkclean, full CI (Test and Build) green.Reviewer focus:
resolveStoredToolName(apps/sim/lib/workflows/subblocks/display.ts) — this is now the single policy for all three surfaces.getBlockcarry theuseCustomBlockOverlayVersiondep (canvas summary, panel picker, search index) per the contract inclient-overlay.ts.custom_${title}executor id); the read-only preview resolves without live MCP/custom data by design.Checklist
Screenshots/Videos
No visual change for normal flows: chips already showed the canonical name (the stored title was snapshotted from it at add-time). The change only prevents state-edited titles from surfacing in the UI.
🤖 Generated with Claude Code