fix(execute-command): normalize both sides of variable name comparison, remove unused userId

Fix asymmetric normalization in resolveWorkflowVariables where the stored
variable name was normalized but the reference name was only trimmed. This
caused <variable.MyVar> to fail matching a variable named "MyVar". Applied
the same fix to the function route which had the identical bug.

Also removed unused userId field from the execute-command tool config
request body — auth identity comes from checkInternalAuth, not the body.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Waleed Latif
2026-03-05 13:16:15 -08:00
parent 5dc31b5cf9
commit 0f293e8584
3 changed files with 2 additions and 3 deletions

View File

@@ -366,7 +366,7 @@ function resolveWorkflowVariables(
const variableName = match[1].trim()
const foundVariable = Object.entries(workflowVariables).find(
([_, variable]) => normalizeName(variable.name || '') === variableName
([_, variable]) => normalizeName(variable.name || '') === normalizeName(variableName)
)
if (!foundVariable) {

View File

@@ -31,7 +31,7 @@ function resolveWorkflowVariables(command: string, workflowVariables: Record<str
while ((match = regex.exec(command)) !== null) {
const variableName = match[1].trim()
const foundVariable = Object.entries(workflowVariables).find(
([_, variable]) => normalizeName(variable.name || '') === variableName
([_, variable]) => normalizeName(variable.name || '') === normalizeName(variableName)
)
if (!foundVariable) {

View File

@@ -82,7 +82,6 @@ export const executeCommandRunTool: ToolConfig<ExecuteCommandInput, ExecuteComma
blockNameMapping: params.blockNameMapping || {},
blockOutputSchemas: params.blockOutputSchemas || {},
workflowId: params._context?.workflowId,
userId: params._context?.userId,
}),
},