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:
message_update with a text_delta containing intermediate progress
message_end whose assistant message contains only a tool-call block
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.
Summary
PiAgent.createOutputInterpreter()retains text from an earliermessage_updateas 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:
message_updatewith atext_deltacontaining intermediate progressmessage_endwhose assistant message contains only a tool-call blockagent_endwhose last assistant message contains only a tool-call blockThe 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
answerrather 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.