Feat/mship block stream#4626
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR adds end-to-end NDJSON streaming support to the Mothership block execution path so long-running headless requests send heartbeats to prevent HTTP proxy timeouts, and assistant content chunks reach the client incrementally.
Confidence Score: 5/5Safe to merge — the streaming and non-streaming paths are cleanly separated, abort/cleanup handling is symmetric, and the previously flagged reader-lock gap is fixed. Both the streaming and non-streaming branches have consistent error handling and resource cleanup. The reader lock is properly released via try/finally in both readMothershipExecuteResponse and createMothershipStreamingExecution. Abort signals thread correctly through the new lifecycleAbortController and stream cancel callbacks. Tests cover the heartbeat, chunk, error, and cancel scenarios. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Handler as MothershipBlockHandler
participant Route as POST /api/mothership/execute
participant Lifecycle as runHeadlessCopilotLifecycle
participant Client as Stream Consumer
Handler->>Route: POST (Accept: application/x-ndjson)
Route->>Route: wantsStreamedExecuteResponse true
Route-->>Handler: 200 application/x-ndjson
Route->>Client: type heartbeat
Route->>Lifecycle: runLifecycle(onEvent)
loop Every 15s idle
Route->>Client: type heartbeat
end
loop On text event
Lifecycle-->>Route: text event
Route->>Client: type chunk content
end
Lifecycle-->>Route: result
alt success
Route->>Client: type final data
else failure
Route->>Client: type error
end
Route->>Client: stream close
alt isContentSelectedForStreaming
Handler->>Handler: createMothershipStreamingExecution
Client->>Handler: stream.cancel abortController.abort
else non-streaming
Handler->>Handler: readMothershipExecuteResponse
end
Reviews (3): Last reviewed commit: "Fix" | Re-trigger Greptile |
|
@greptile review |
|
@cursor review |
PR SummaryMedium Risk Overview Updates the executor’s Reviewed by Cursor Bugbot for commit eee2da0. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit eee2da0. Configure here.
|
@greptile review |

Summary
Make mship block stream
Type of Change
Testing
Manual
Checklist