Skip to content

service: turn replies are not streamed #1140

Description

@edwin-zvs

A service turn's reply is returned whole. POST /svc/<name> runs the turn and answers with the final text; there is no incremental delivery, so a caller sees nothing until the harness is completely done.

For an agent turn that can run for minutes this is a poor fit, and it is the reason the approval-reporting work (#1113 / spec 0171) had to exist in the shape it does: with no stream, a caller cannot otherwise distinguish "blocked on a human" from "still working", so that state had to be exposed through the result-polling path instead.

Design questions:

  • Transport. SSE is the obvious fit for the HTTP channel and needs no client change beyond reading a stream. It does not generalize to Slack, which wants periodic message edits instead — so this is likely per-channel behavior over a shared incremental-event source rather than one mechanism.
  • Granularity. Token deltas, or coarser milestones (turn started, tool call, reply)? Note the reply-truncation bug (fix(service): reassemble streamed assistant replies #1107) came from smith emitting one message event per token delta — the daemon already sees fine-grained events and currently reassembles them; streaming means choosing what to forward rather than building new plumbing.
  • Interaction with parked approvals. A stream is the natural place to surface "waiting on approval" as it happens rather than on poll.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions