Skip to content

rotated stream segments with open task_update chunks render as errored in 4.40.0 #911

Description

@aryash14

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

  1. createSlackAdapter({ agentView: true }) on 4.40.0, default streamSegmentMaxAgeMs.
  2. 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.
  3. 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.

Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions