Skip to content

PiAgent retains stale streamed text after a text-free terminal assistant message #1629

Description

@aviggiano

Summary

PiAgent.createOutputInterpreter() retains text from an earlier message_update as the completed answer when the authoritative terminal assistant message contains no text, for example a tool-only content array.

Reproduction

Feed the interpreter these generic JSON events in order:

  1. message_update with a text_delta containing intermediate progress
  2. message_end whose assistant message contains only a tool-call block
  3. agent_end whose last assistant message contains only a tool-call block

The completed event reports the earlier progress text as answer.

Expected behavior

A terminal assistant message is authoritative even when it has no text. The completed event should omit answer rather than reuse text from a previous assistant update.

Impact

Consumers can mistake progress narration for a final response, including in structured-output repair and diagnostics.

A downstream compatibility regression is tracked at monad-developers/ultrafuzz#888.

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