-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix(parallel): variable resolution in collection #2314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryEnables runtime resolution of dynamic distribution items in parallel blocks by mirroring the loop resolver pattern. Previously, parallel blocks could not resolve references like Key changes:
Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Executor as DAGExecutor
participant ParallelOrch as ParallelOrchestrator
participant NodeOrch as NodeExecutionOrchestrator
participant Resolver as VariableResolver
participant ParallelResolver as ParallelResolver
participant BlockExec as BlockExecutor
Executor->>Resolver: new VariableResolver()
Executor->>ParallelOrch: new ParallelOrchestrator()
Executor->>ParallelOrch: setResolver(resolver)
Note over ParallelOrch: Resolver now available for runtime resolution
NodeOrch->>NodeOrch: executeNode(ctx, nodeId)
NodeOrch->>ParallelOrch: getParallelScope(ctx, parallelId)
ParallelOrch-->>NodeOrch: undefined (not initialized)
NodeOrch->>ParallelOrch: initializeParallelScope(ctx, parallelId, ...)
ParallelOrch->>ParallelOrch: resolveDistributionItems(ctx, config)
alt Distribution is reference
ParallelOrch->>Resolver: resolveSingleReference(ctx, '', rawItems)
Resolver-->>ParallelOrch: resolved array or object
else Distribution is static data
ParallelOrch->>ParallelOrch: return as-is or parse JSON
end
ParallelOrch->>ParallelOrch: Store items in scope.items
ParallelOrch-->>NodeOrch: ParallelScope with items
Note over NodeOrch: Scope initialized BEFORE execution
NodeOrch->>BlockExec: execute(ctx, node, block)
BlockExec->>Resolver: resolve reference
Resolver->>ParallelResolver: resolve(reference, context)
ParallelResolver->>ParallelResolver: Get parallelScope from ctx
ParallelResolver->>ParallelResolver: items = scope.items ?? getDistributionItems()
Note over ParallelResolver: Prioritizes runtime-resolved items from scope
ParallelResolver->>ParallelResolver: return items[branchIndex]
ParallelResolver-->>Resolver: currentItem value
Resolver-->>BlockExec: resolved value
BlockExec-->>NodeOrch: execution output
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6 files reviewed, no comments
* Fix var resolution in parallel * Fix parallel * Clean logs * FIx loop error port
fix(parallel): variable resolution in collection (simstudioai#2314)
Summary
Fix variable resolution in parallel for each collection
Type of Change
Testing
Manual
Checklist