-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix(copilot): copilot edit router block accepts semantic handles #2857
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 SummaryThis PR enhances the copilot router block validation to accept semantic handle formats in addition to internal UUID-based handles. The changes enable the copilot to use more readable handle formats like Key changes:
The implementation mirrors the existing Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Copilot
participant EditWorkflow
participant Validation
participant Sanitizer
participant UI
Note over Copilot,UI: Copilot Edit Flow with Semantic Handles
Copilot->>EditWorkflow: edit_workflow with semantic handles<br/>(e.g., router-{blockId}-route-1)
EditWorkflow->>Validation: validateSourceHandleForBlock
alt Block type is router_v2
Validation->>Validation: Check handle starts with "router-"
Validation->>Validation: validateRouterHandle
Validation->>Validation: Accept UUID format: router-{uuid}
Validation->>Validation: Accept semantic format: router-{blockId}-route-N
Validation->>Validation: Accept title format: router-{blockId}-{title}
Validation-->>EditWorkflow: valid=true
else Block type is condition
Validation->>Validation: validateConditionHandle
Validation-->>EditWorkflow: valid=true/false
end
EditWorkflow-->>Copilot: Edge created successfully
Note over Sanitizer,UI: Sanitization for Training Data
UI->>Sanitizer: sanitizeForCopilot(workflowState)
Sanitizer->>Sanitizer: extractConnectionsForBlock
loop For each edge
Sanitizer->>Sanitizer: convertToSemanticHandle
alt Router block
Sanitizer->>Sanitizer: convertRouterHandleToSemantic<br/>(router-{uuid} → router-{blockId}-route-N)
else Condition block
Sanitizer->>Sanitizer: convertConditionHandleToSemantic<br/>(condition-{uuid} → condition-{blockId}-if)
end
end
Sanitizer-->>UI: CopilotWorkflowState with semantic handles
|
Summary
Fix copilot router block
Type of Change
Testing
Manual
Checklist