mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
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:
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -82,7 +82,6 @@ export const executeCommandRunTool: ToolConfig<ExecuteCommandInput, ExecuteComma
|
||||
blockNameMapping: params.blockNameMapping || {},
|
||||
blockOutputSchemas: params.blockOutputSchemas || {},
|
||||
workflowId: params._context?.workflowId,
|
||||
userId: params._context?.userId,
|
||||
}),
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user