mirror of
https://github.com/simstudioai/sim.git
synced 2026-02-11 07:04:58 -05:00
v0.2.3: fix (#592)
* fix(variable resolution): use variable references to not have escaping issues (#587) * fix(variable-resolution): don't inject stringified json, use var refs * fix lint * remove unused var --------- Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@vikhyaths-air.lan> * fix(subblock updates): special selectors persistence (#591) * fix(knowledge-base-selector): should trigger sockets event for persistence * fix subblock value updates for non useSubblockValue components * fix lint --------- Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@Vikhyaths-MacBook-Air.local> * fix(race-cond): for auto-connect rare race condition between adding edge + block (#582) * auto connect race condition * fix lint * Update apps/sim/hooks/use-collaborative-workflow.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Update apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * fix lint --------- Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@Vikhyaths-Air.attlocal.net> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@Vikhyaths-MacBook-Air.local> --------- Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@vikhyaths-air.lan> Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@Vikhyaths-MacBook-Air.local> Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@Vikhyaths-Air.attlocal.net> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
b0c1547198
commit
f4e627a9f7
@@ -58,14 +58,12 @@ function resolveCodeVariables(
|
||||
|
||||
// Find the block ID by looking for a block name that normalizes to this value
|
||||
let blockId = null
|
||||
let matchedBlockName = null
|
||||
|
||||
for (const [blockName, id] of Object.entries(blockNameMapping)) {
|
||||
// Apply the same normalization logic as the UI: remove spaces and lowercase
|
||||
const normalizedName = blockName.replace(/\s+/g, '').toLowerCase()
|
||||
if (normalizedName === normalizedBlockName) {
|
||||
blockId = id
|
||||
matchedBlockName = blockName
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -151,9 +149,6 @@ export async function POST(req: NextRequest) {
|
||||
})
|
||||
|
||||
// Resolve variables in the code with workflow environment variables
|
||||
logger.info(`[${requestId}] Original code:`, code.substring(0, 200))
|
||||
logger.info(`[${requestId}] Execution params keys:`, Object.keys(executionParams))
|
||||
|
||||
const { resolvedCode, contextVariables } = resolveCodeVariables(
|
||||
code,
|
||||
executionParams,
|
||||
@@ -162,9 +157,6 @@ export async function POST(req: NextRequest) {
|
||||
blockNameMapping
|
||||
)
|
||||
|
||||
logger.info(`[${requestId}] Resolved code:`, resolvedCode.substring(0, 200))
|
||||
logger.info(`[${requestId}] Context variables keys:`, Object.keys(contextVariables))
|
||||
|
||||
const executionMethod = 'vm' // Default execution method
|
||||
|
||||
// // Try to use Freestyle if the API key is available
|
||||
|
||||
Reference in New Issue
Block a user