feat(copilot): add tools to access block outputs and upstream references#2546
Merged
feat(copilot): add tools to access block outputs and upstream references#2546
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Author
|
@greptile |
Contributor
Greptile SummaryThis PR adds two new copilot tools that enable the AI assistant to introspect workflow structure and block relationships. The Key Changes:
Issues Found:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Copilot
participant GetBlockOutputsTool
participant GetUpstreamRefsTool
participant WorkflowRegistry
participant WorkflowStore
participant SubBlockStore
participant VariablesStore
participant BlockPathCalculator
Note over Copilot,BlockPathCalculator: Get Block Outputs Flow
Copilot->>GetBlockOutputsTool: execute(blockIds?)
GetBlockOutputsTool->>WorkflowRegistry: getState()
WorkflowRegistry-->>GetBlockOutputsTool: activeWorkflowId
GetBlockOutputsTool->>WorkflowStore: getState()
WorkflowStore-->>GetBlockOutputsTool: blocks, loops, parallels
GetBlockOutputsTool->>SubBlockStore: getWorkflowSubBlockValues(workflowId)
SubBlockStore-->>GetBlockOutputsTool: subBlockValues
loop For each block
GetBlockOutputsTool->>GetBlockOutputsTool: computeBlockOutputPaths(block, ctx)
GetBlockOutputsTool->>GetBlockOutputsTool: formatOutputsWithPrefix(paths, blockName)
end
GetBlockOutputsTool->>VariablesStore: getWorkflowVariables(workflowId)
VariablesStore-->>GetBlockOutputsTool: variables
GetBlockOutputsTool-->>Copilot: {blocks: [...], variables: [...]}
Note over Copilot,BlockPathCalculator: Get Upstream References Flow
Copilot->>GetUpstreamRefsTool: execute(blockIds)
GetUpstreamRefsTool->>WorkflowRegistry: getState()
WorkflowRegistry-->>GetUpstreamRefsTool: activeWorkflowId
GetUpstreamRefsTool->>WorkflowStore: getState()
WorkflowStore-->>GetUpstreamRefsTool: blocks, edges, loops, parallels
GetUpstreamRefsTool->>SubBlockStore: getWorkflowSubBlockValues(workflowId)
SubBlockStore-->>GetUpstreamRefsTool: subBlockValues
loop For each blockId
GetUpstreamRefsTool->>BlockPathCalculator: findAllPathNodes(edges, blockId)
BlockPathCalculator-->>GetUpstreamRefsTool: ancestorIds
GetUpstreamRefsTool->>GetUpstreamRefsTool: determine containing loops/parallels
GetUpstreamRefsTool->>GetUpstreamRefsTool: build accessibleBlocks with outputs
end
GetUpstreamRefsTool->>VariablesStore: getWorkflowVariables(workflowId)
VariablesStore-->>GetUpstreamRefsTool: variables
GetUpstreamRefsTool-->>Copilot: {results: [{blockId, accessibleBlocks, variables}]}
|
waleedlatif1
pushed a commit
that referenced
this pull request
Dec 23, 2025
…ces (#2546) * Add copilot references tools * Minor fixes * Omit vars field in block outputs when id is provided
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add tools to access block outputs and upstream references
Type of Change
Testing
Manual
Checklist