Skip to content

Commit f31ac10

Browse files
committed
fix(copilot): exclude downstream loop nodes and parallel siblings from accessible references
1 parent de8ef28 commit f31ac10

File tree

1 file changed

+2
-14
lines changed
  • apps/sim/lib/copilot/orchestrator/tool-executor/workflow-tools

1 file changed

+2
-14
lines changed

apps/sim/lib/copilot/orchestrator/tool-executor/workflow-tools/queries.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
loadDeployedWorkflowState,
1515
loadWorkflowFromNormalizedTables,
1616
} from '@/lib/workflows/persistence/utils'
17-
import { isInputDefinitionTrigger } from '@/lib/workflows/triggers/input-definition-triggers'
1817
import { hasTriggerCapability } from '@/lib/workflows/triggers/trigger-utils'
1918
import { getBlock } from '@/blocks/registry'
2019
import { normalizeName } from '@/executor/constants'
@@ -457,20 +456,9 @@ export async function executeGetBlockUpstreamReferences(
457456
const accessibleIds = new Set<string>(ancestorIds)
458457
accessibleIds.add(blockId)
459458

460-
const starterBlock = Object.values(blocks).find((b) => isInputDefinitionTrigger(b.type))
461-
if (starterBlock && ancestorIds.includes(starterBlock.id)) {
462-
accessibleIds.add(starterBlock.id)
463-
}
464-
465-
containingLoopIds.forEach((loopId) => {
466-
accessibleIds.add(loopId)
467-
loops[loopId]?.nodes?.forEach((nodeId: string) => accessibleIds.add(nodeId))
468-
})
459+
containingLoopIds.forEach((loopId) => accessibleIds.add(loopId))
469460

470-
containingParallelIds.forEach((parallelId) => {
471-
accessibleIds.add(parallelId)
472-
parallels[parallelId]?.nodes?.forEach((nodeId: string) => accessibleIds.add(nodeId))
473-
})
461+
containingParallelIds.forEach((parallelId) => accessibleIds.add(parallelId))
474462

475463
const accessibleBlocks: AccessibleBlockEntry[] = []
476464

0 commit comments

Comments
 (0)