rotated stream segments with open task_update chunks render as errored in 4.40.0
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.4k
- Forks
- 314
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 63
Description
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 })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.- 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/adapter-slack/src/index.ts at rotateSegment, where the retired segment is stopped before startNextSegment. Trace the open task_update state and verify that each in-progress task is closed during rotation; reproduce with the async generator scenario and confirm the retired Slack segment settles without a red error indicator.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 84/100