ReadonlymaxReadonlymaxReadonlymaxReadonlymaxFormats the consolidated output for terminal reporting.
The backend's own text, or an empty string when it produced none: a placeholder here would read as an answer beside a failure the adapter reports.
Whether a current message is cut or was dropped, or the joined output was cut.
Records tool state transition with bound protection. Returns true if transition was newly recorded.
Drops messages that are not part of the answer, such as commentary a backend marks as interim once its final answer arrives; their bytes return to the budget, and their truncation no longer marks the answer as truncated (CUR-005).
Terminal answer replacement: supersedes intermediate draft messages with the authoritative completed response.
Appends or updates an assistant response message fragment. Under budget pressure, always replaces draft with latest bounded text and markers.
Unified Stream Reducer Standardizes response assembly, terminal answer replacement, tool tracking, and strict memory bounds across provider adapters. Line framing belongs to createLineDecoder in execution/stream.