-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fix(child-workflow-error-spans): pass trace-spans accurately in block logs #3054
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 SummaryThis PR refactors trace span handling for nested child workflows to separate display concerns from execution tracking data. The key improvements are:
The changes maintain backward compatibility by checking both Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant WH as WorkflowHandler
participant BE as BlockExecutor
participant WF as Child Workflow
participant TS as TraceSpans Builder
participant UI as Log Details UI
Note over WH,UI: Success Path - Child Workflow Execution
WH->>WF: Execute child workflow
WF->>WH: Return execution result
WH->>WH: captureChildWorkflowLogs(result)
WH->>TS: buildTraceSpans(result)
TS->>WH: Return trace spans
WH->>WH: Transform spans with metadata
WH->>BE: Return output with childTraceSpans
BE->>BE: Extract childTraceSpans from output
BE->>BE: Store childTraceSpans separately in blockLog
BE->>BE: filterOutputForLog (removes childTraceSpans)
Note over BE: Output is clean for display
Note over WH,UI: Error Path - Nested Workflow Failure
WH->>WF: Execute child workflow
WF-->>WH: Throw error with result
WH->>WH: captureChildWorkflowLogs(error.executionResult)
WH->>TS: buildTraceSpans(result)
TS->>WH: Return trace spans
WH->>WH: parseNestedWorkflowError(error)
WH->>WH: buildNestedWorkflowErrorMessage()
Note over WH: Format: "workflow" failed: error<br/>or Workflow chain: A → B | error
WH-->>BE: Throw ChildWorkflowError with childTraceSpans
BE->>BE: Extract childTraceSpans from error
BE->>BE: Store childTraceSpans in blockLog
BE->>BE: filterOutputForLog (removes childTraceSpans)
Note over WH,UI: Trace Span Processing
UI->>TS: Request trace spans from logs
TS->>TS: Check log.childTraceSpans (preferred)
TS->>TS: Fallback to log.output.childTraceSpans
TS->>TS: flattenWorkflowChildren(spans)
TS->>TS: Clean childTraceSpans from output
TS->>UI: Return processed spans
UI->>UI: filterHiddenOutputKeys(finalOutput)
Note over UI: Display clean output without childTraceSpans
|
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.
4 files reviewed, no comments
|
@cursor review |
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.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Summary
Type of Change
Testing
Tested manually
Checklist