fix(logs): always capture cost, logging size failures#2487
Merged
icecrasher321 merged 9 commits intostagingfrom Dec 20, 2025
Merged
fix(logs): always capture cost, logging size failures#2487icecrasher321 merged 9 commits intostagingfrom
icecrasher321 merged 9 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile SummaryThis PR fixes a critical bug where execution costs were not captured when logs failed to write to the database due to size constraints. The implementation adds three key improvements:
Key Issue Found:
Recommendation:
Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant WE as Workflow Executor
participant LS as LoggingSession
participant EL as ExecutionLogger
participant DF as DisplayFilters
participant DB as Database
WE->>LS: safeComplete(traceSpans)
LS->>LS: complete(traceSpans)
LS->>EL: completeWorkflowExecution(traceSpans)
EL->>DF: filterForDisplay(traceSpans)
Note over DF: Truncate strings to 100K<br/>Remove null bytes<br/>Handle circular refs
DF-->>EL: filtered traceSpans
EL->>DB: Store execution log
alt Database write fails (too large)
DB-->>EL: Error
EL-->>LS: Error
LS->>LS: completeWithCostOnlyLog()
LS->>LS: calculateCostSummary(traceSpans)
Note over LS: Extract costs from<br/>oversized traceSpans
LS->>EL: completeWorkflowExecution(empty traceSpans)
Note over LS: Pass empty array to avoid<br/>size issues
EL->>DF: filterForDisplay([])
DF-->>EL: []
EL->>DB: Store cost-only log
DB-->>EL: Success
Note over DB: Cost captured,<br/>traceSpans empty
end
|
Collaborator
Author
|
@greptile |
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
Type of Change
Testing
Testing with @aadamgough
Checklist