Skip to content

/v1 non-streaming returns mid-turn narration fragments as the final message — callers can't tell a finished turn from a dying one #2234

Description

@mabry1985

Observed (3× tonight, protoEngineer workspace via /v1/chat/completions)

Non-streaming /v1/chat/completions turns intermittently return with the final assistant message TRUNCATED mid-thought while the turn's tool calls continue/complete server-side:

  • "Running both calls in parallel now." — returned as the ENTIRE completion; audit log shows both tool calls executed AFTER the response returned.
  • "Now let me check the existing test file for the bundled-asset tests to understand the pattern from feat: Ship Project Manager archetype (soul preset + catalog row) #2178:" — returned mid-sentence; the turn's board calls never happened (turn died).
  • "Both created. Now mark them ready and verify." — returned; one mark_ready then failed silently out-of-band.

Effect on programmatic consumers: the caller can't distinguish "turn finished, here's the result" from "turn still executing / died mid-flight" — a stateless-driver pattern (curated task per call, #2119) reads these as complete answers and makes wrong decisions (we shipped a stale-brief coder dispatch because of the third case).

Ask

The non-streaming path should return only when the agent loop actually terminates (final synthesis after the last tool call), or set finish_reason to something other than "stop" when the turn was interrupted/limited — never a mid-loop narration fragment presented as the final message. Repro appears correlated with long multi-tool turns (board batch operations) and possibly max-iteration/timeout edges.

Metadata

Metadata

Assignees

No one assigned

    Labels

    team-readyTriaged and approved for autonomous team dispatch — the ONLY intake gate the board pipeline accepts

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions