Skip to content

streamChatTurn/consumeChatStream: surface sidecar interactions via an onInteraction seam (unblock product live agent-questions) #175

Description

@drewstone

Motivation

Products that consume the chat stream through agent-app's streamChatTurn / consumeChatStream primitive cannot surface a live agent question (a sidecar interaction — the agent pausing to ask the user something before continuing). The primitive exposes no onInteraction callback and emits no interaction NDJSON line, so the interaction event never reaches the client.

Motivating consumer: tax-agent (Wave 2b, PR #368). Tax leans on streamChatTurn, so it could land the full interactions contract (typed shapes, dedupe, monotonic status guard, late-answer routing) + the server half (a backend-agnostic sidecar interactions client + a POST route that answers all content-duplicate pending asks and re-lists to prove unblock) — all unit-tested — but the live client half is inert: there is no seam to surface the ask on the turn, mount the question card, or drive the composer-as-answer round-trip.

By contrast legal-agent, which hand-rolls its own stream hook, implemented the full live path (PR #253) — because it owns the stream reader. The gap is specific to consumers of the agent-app substrate primitive.

Requested enhancement

  • Add an onInteraction callback (and/or normalize an interaction event in the chat stream) to streamChatTurn / consumeChatStream, sourced from backend.interactions.
  • Emit the interaction as a first-class stream event so a consumer can: mark the turn 'awaiting your answer', render the question card, and POST the answer back through the sidecar to unblock the run.

Acceptance

tax-agent's useChatStream surfaces the live ask via the new seam; the already-landed question card + composer-answer + late-answer paths (PR #368) round-trip an answer and unblock the sidecar broker — with no product-side re-implementation of the stream reader.

Refs

  • tax-agent PR #368 (server + contract landed, live client deferred on this)
  • legal-agent PR #253 (full live path, only possible because it hand-rolls the stream hook)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions