Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.8k
fix(workflow): render agent tool chip names from static sources, not stored title#5501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
932dd8c
fix(workflow): render agent tool chip names from static sources, not …
j15z a31a492
fix(workflow): cover workflow-as-tool and custom-tool fallbacks in st…
j15z 9e933fc
fix(workflow): resolve panel chip names via unfiltered block registry
j15z 4a6fee5
fix(workflow): resolve MCP tool names from live server data in canvas…
j15z 7327d4f
refactor(workflow): single shared tool-name resolver; fix overlay, fa…
j15z f768b00
fix(workflow): thread custom-tool and MCP data into the search indexe…
j15z d76e45d
fix(workflow): recompute search index when the custom-block overlay h…
j15z File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
28 changes: 21 additions & 7 deletions
28 ...ponents/panel/components/editor/components/sub-block/components/tool-input/tool-input.tsx
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
19 changes: 19 additions & 0 deletions
19 ...kspace/[workspaceId]/w/[workflowId]/components/search-replace/workflow-search-replace.tsx
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
35 changes: 25 additions & 10 deletions
35 ...m/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/workflow-block.tsx
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -23,6 +23,7 @@ import type { | ||
| } from '@/lib/workflows/search-replace/types' | ||
| import { pathToKey, walkStringValues } from '@/lib/workflows/search-replace/value-walker' | ||
| import { SELECTOR_CONTEXT_FIELDS } from '@/lib/workflows/subblocks/context' | ||
| import { resolveStoredToolName } from '@/lib/workflows/subblocks/display' | ||
| import { | ||
| buildCanonicalIndex, | ||
| buildSubBlockValues, | ||
| @@ -931,6 +932,8 @@ function addToolInputMatches({ | ||
| workflowId, | ||
| credentialTypeById, | ||
| blockConfigs, | ||
| customTools, | ||
| mcpToolNamesById, | ||
| }: { | ||
| matches: WorkflowSearchMatch[] | ||
| block: WorkflowSearchBlockState | ||
| @@ -950,11 +953,20 @@ function addToolInputMatches({ | ||
| workflowId?: string | ||
| credentialTypeById?: Record<string, string | undefined> | ||
| blockConfigs?: WorkflowSearchIndexerOptions['blockConfigs'] | ||
| customTools?: WorkflowSearchIndexerOptions['customTools'] | ||
| mcpToolNamesById?: WorkflowSearchIndexerOptions['mcpToolNamesById'] | ||
| }) { | ||
| const parentCanonicalModes = getSearchCanonicalModes(block) | ||
| parseStoredToolInputValue(value).forEach((tool, toolIndex) => { | ||
| if (mode !== 'resource' && tool.title) { | ||
| // Index the resolved display name (not the stored mutable title) so | ||
| // search text and highlights match what the tool chip actually renders. | ||
| const toolDisplayName = resolveStoredToolName(tool, { | ||
| customTools, | ||
| mcpToolNamesById, | ||
| getBlockConfig: (type) => blockConfigs?.[type] ?? getBlock(type), | ||
| }) | ||
j15z marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| if (mode !== 'resource' && toolDisplayName) { | ||
| addTextMatches({ | ||
| matches, | ||
| idPrefix: 'tool-input-title', | ||
| @@ -963,7 +975,7 @@ function addToolInputMatches({ | ||
| canonicalSubBlockId, | ||
| subBlockType: 'tool-input', | ||
| fieldTitle: 'Tool', | ||
| value: tool.title, | ||
| value: toolDisplayName, | ||
| valuePath: [toolIndex, 'title'], | ||
| target: { kind: 'subblock' }, | ||
| query, | ||
| @@ -1228,6 +1240,8 @@ export function indexWorkflowSearchMatches( | ||
| workflowId, | ||
| blockConfigs = {}, | ||
| credentialTypeById, | ||
| customTools, | ||
| mcpToolNamesById, | ||
| } = options | ||
| const matches: WorkflowSearchMatch[] = [] | ||
| @@ -1363,6 +1377,8 @@ export function indexWorkflowSearchMatches( | ||
| workflowId, | ||
| credentialTypeById, | ||
| blockConfigs, | ||
| customTools, | ||
| mcpToolNamesById, | ||
| }) | ||
| continue | ||
| } | ||
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
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Uh oh!
There was an error while loading. Please reload this page.