Skip to content

Commit fd7273d

Browse files
committed
Fix asymmetric workflow normalization in tool registry
Normalize requestedWorkflows before passing to selectWorkflowsForMcp to ensure consistent matching against workflow IDs. Previously, mixed-case workflow names would pass the unknown workflow check but fail to match during selection, resulting in silent no-ops.
1 parent 32eab47 commit fd7273d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/utils/tool-registry.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,17 @@ export async function applyWorkflowSelectionFromManifest(
187187
}
188188
const allWorkflows = [...manifest.workflows.values(), ...customSelection.workflows];
189189

190+
// Normalize requested workflows for consistent matching
191+
const normalizedRequestedWorkflows = requestedWorkflows
192+
?.map(normalizeName)
193+
.filter((name) => name.length > 0);
194+
190195
// Select workflows using manifest-driven rules
191-
const selectedWorkflows = selectWorkflowsForMcp(allWorkflows, requestedWorkflows, ctx);
196+
const selectedWorkflows = selectWorkflowsForMcp(allWorkflows, normalizedRequestedWorkflows, ctx);
192197
const knownWorkflowIds = new Set(allWorkflows.map((workflow) => workflow.id));
193-
const unknownRequestedWorkflows = (requestedWorkflows ?? [])
194-
.map(normalizeName)
195-
.filter((workflowName) => workflowName.length > 0 && !knownWorkflowIds.has(workflowName));
198+
const unknownRequestedWorkflows = (normalizedRequestedWorkflows ?? []).filter(
199+
(workflowName) => !knownWorkflowIds.has(workflowName),
200+
);
196201
if (unknownRequestedWorkflows.length > 0) {
197202
const uniqueUnknownRequestedWorkflows = [...new Set(unknownRequestedWorkflows)];
198203
log(

0 commit comments

Comments
 (0)