fix(mothership): queue supersede crash#4297
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview
Lifecycle outcome classification is updated to treat Reviewed by Cursor Bugbot for commit cd1f826. Configure here. |
Greptile SummaryThis PR fixes a crash ("queue supersede") where a user-initiated stop propagated via Redis abort marker would close the Go SSE body before the 250 ms poller's next tick, causing Confidence Score: 5/5Safe to merge; no new P0 or P1 findings — all substantive concerns were addressed in prior review threads. The logic is well-reasoned: fail-closed on Redis error, correct abort-before-clear ordering in the poller, consistent outcome priority between SSE and headless paths, and strong test coverage for all new branches including the Redis-failure edge case. The open design choices (marker not cleared on the body-close path, 250 ms poll interval) were deliberately discussed in prior review threads and left intentionally. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Browser
participant SimSSE as Sim (SSE node)
participant Redis
participant GoBackend as Go Backend
Browser->>SimSSE: POST /chat/abort
SimSSE->>Redis: writeAbortMarker(streamId)
SimSSE-->>Browser: 200 OK
Note over GoBackend: Observes stop signal,
closes SSE body cleanly
(before 250ms poller tick)
GoBackend-->>SimSSE: SSE body closes (no terminal event)
SimSSE->>SimSSE: !streamComplete && !aborted && !wasAborted
SimSSE->>Redis: hasAbortMarker(messageId)
Redis-->>SimSSE: true
SimSSE->>SimSSE: onAbortObserved(MarkerObservedAtBodyClose)
SimSSE->>SimSSE: abortController.abort(reason)
SimSSE->>SimSSE: context.wasAborted = true, endedOn = Aborted
Note over SimSSE: No 503 thrown — outcome
classified as cancelled
SimSSE->>SimSSE: isExplicitStopReason → true, recordCancelled → explicit_stop
Reviews (2): Last reviewed commit: "abort observed marker" | Re-trigger Greptile |
|
bugbot run |
|
@greptile |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit cd1f826. Configure here.
Summary
Queue supersede via double enter abort propagation state machine improvement.
Type of Change
Testing
Tested manually
Checklist