improvement(mothership): treat error as terminal event in traces#4290
improvement(mothership): treat error as terminal event in traces#4290icecrasher321 merged 1 commit intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview Adjusts the inline documentation to reflect the new terminal event definition ( Reviewed by Cursor Bugbot for commit 4824ea3. Configure here. |
Greptile SummaryThis PR fixes a false-positive in the Confidence Score: 5/5This PR is safe to merge — the one-line change is logically correct and matches the existing handler contract. The fix is minimal and provably correct: No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[SSE Read Loop ends] --> B{context.streamComplete?}
B -- No --> C[Log error: no terminal event\nendedOn = ClosedNoTerminal\nthrow CopilotBackendError]
B -- Yes --> D[stampSseReadLoopSpan called]
D --> E{counters.eventsByType.complete > 0\nOR counters.eventsByType.error > 0}
E -- Yes --> F[terminalEventSeen = true]
E -- No --> G[terminalEventSeen = false]
F --> H{opts.expectedTerminal?}
G --> H
H -- Yes + terminalEventSeen=false --> I[terminalEventMissing = true\nSpan status → ERROR]
H -- No or terminalEventSeen=true --> J[terminalEventMissing = false\nSpan status → UNSET]
style I fill:#f88,stroke:#d00
style J fill:#8f8,stroke:#080
Reviews (1): Last reviewed commit: "improvement(mothership): treat error as ..." | Re-trigger Greptile |
Summary
Treat errors as terminal events in traces
Type of Change