v0.6.58: queue abort state machine improvement, contributing guide #4298
v0.6.58: queue abort state machine improvement, contributing guide #4298icecrasher321 merged 2 commits intomainfrom
Conversation
icecrasher321
commented
Apr 25, 2026
- fix(mothership): queue supersede crash (fix(mothership): queue supersede crash #4297)
- chore(guide): update contributing guide (chore(guide): update contributing guide #4296)
* fix(mothership): queue supersede crash * add test * abort observed marker
* chore(guide): update contributing guide * fix md
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryMedium Risk Overview Tightens cancellation semantics and polling. Streaming/headless lifecycles now treat Docs: updates Reviewed by Cursor Bugbot for commit d93a6f5. Configure here. |
Greptile SummaryThis PR fixes a crash where the Go backend "supersedes" a queued request by closing the SSE body without emitting a terminal event — previously misclassified as a 503 Confidence Score: 5/5Safe to merge — the fix is tightly scoped, fails safely when Redis is unavailable, and is backed by targeted unit tests for every new branch. No P0 or P1 issues found. The abort-at-body-close path correctly defaults to the existing 503 error when the marker check throws. Abort-before-clear ordering and the no-double-abort guard are both verified by new tests. Outcome classification priority (success > cancelled > error) is logically correct. The poll cadence reduction is an intentional trade-off clearly documented in the code. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant SimSSE as Sim SSE (start.ts)
participant StreamLoop as runStreamLoop (stream.ts)
participant Go as Go Backend
participant Redis
Client->>SimSSE: POST /api/copilot/chat
SimSSE->>StreamLoop: runCopilotLifecycle(onAbortObserved)
StreamLoop->>Go: fetch SSE stream
Go-->>StreamLoop: text events (no terminal)
Note over Go: Queue supersede — body closed early
Go-->>StreamLoop: body close (no terminal event)
alt streamComplete=false and signal not aborted
StreamLoop->>Redis: hasAbortMarker(messageId)
alt marker present
Redis-->>StreamLoop: true
StreamLoop->>SimSSE: onAbortObserved(MarkerObservedAtBodyClose)
SimSSE->>SimSSE: abortController.abort(reason)
StreamLoop->>StreamLoop: wasAborted=true, endedOn=Aborted
StreamLoop-->>SimSSE: result cancelled=true
SimSSE-->>Client: complete event status=cancelled
else marker absent
Redis-->>StreamLoop: false
StreamLoop->>StreamLoop: throw CopilotBackendError 503
SimSSE-->>Client: error event
else Redis unavailable
Redis-->>StreamLoop: throws
StreamLoop->>StreamLoop: log warn, fall through to error
StreamLoop->>StreamLoop: throw CopilotBackendError 503
end
end
Reviews (1): Last reviewed commit: "chore(guide): update contributing guide ..." | Re-trigger Greptile |