Summary
A native Slack stream that runs past streamSegmentMaxAgeMs is rotated onto a new message. When the stream carries structured task_update chunks with status: "in_progress", the retired segment renders in Slack with the red error indicator, because rotateSegment stops it without closing the open task.
Reproduction
createSlackAdapter({ agentView: true }) on 4.40.0, default streamSegmentMaxAgeMs.
thread.post(source) where source is an async generator yielding { type: 'task_update', id: 'work', title: 'Working', status: 'in_progress', details: '…' } every ~20 s for 10 minutes.
- Observe the thread after the first rotation (~240 s).
Observed
The retired segment shows the red warning icon next to its title; the new segment continues normally with the replayed open task.
Expected
The retired segment settles cleanly (checkmark or neutral), since the work continues in the next segment.
Cause
rotateSegment in packages/adapter-slack/src/index.ts calls segment.streamer.stop({ token, markdown_text?, session_status: 'processing' }) and sends no closing task_update for tasks still in_progress. Slack renders a stopped stream whose last task chunk is open as an error state. A stop that includes { type: 'task_update', id, status: 'complete' } for each open task before startNextSegment renders cleanly; verified by driving the same calls manually.

Summary
A native Slack stream that runs past
streamSegmentMaxAgeMsis rotated onto a new message. When the stream carries structuredtask_updatechunks withstatus: "in_progress", the retired segment renders in Slack with the red error indicator, becauserotateSegmentstops it without closing the open task.Reproduction
createSlackAdapter({ agentView: true })on4.40.0, defaultstreamSegmentMaxAgeMs.thread.post(source)wheresourceis an async generator yielding{ type: 'task_update', id: 'work', title: 'Working', status: 'in_progress', details: '…' }every ~20 s for 10 minutes.Observed
The retired segment shows the red warning icon next to its title; the new segment continues normally with the replayed open task.
Expected
The retired segment settles cleanly (checkmark or neutral), since the work continues in the next segment.
Cause
rotateSegmentinpackages/adapter-slack/src/index.tscallssegment.streamer.stop({ token, markdown_text?, session_status: 'processing' })and sends no closingtask_updatefor tasks stillin_progress. Slack renders a stopped stream whose last task chunk is open as an error state. Astopthat includes{ type: 'task_update', id, status: 'complete' }for each open task beforestartNextSegmentrenders cleanly; verified by driving the same calls manually.