Skip to content

Events

Goose is run with goose run --output-format stream-json, which emits a line-delimited JSON stream on standard output. Each non-empty line is a complete JSON object carrying a top-level type. The harness layer parses that stream into the normalized harness events every caller consumes.

The stream is made up of four record types:

Goose recordHandling
messageA serialized conversation message whose content is an array of blocks (text, thinking, redactedThinking, toolRequest, toolResponse) processed in order.
notificationSurfaced verbatim as an unknown event rather than parsed from prose.
errorBecomes an error event.
completeThe run boundary. It carries the usage consumed for metrics and flushes any pending assistant span.

Within a message, assistant text blocks are agent progress and assistant thinking blocks are the model’s reasoning. User text is the echoed prompt, and redactedThinking blocks carry no readable text.

Goose streams each fragment as cumulative-or-delta records sharing a message id, so fragments of the same kind and id accumulate into one pending span. A record that restates the pending text replaces it, and any other same-kind, same-id record is appended. A pending span is flushed when activity of a different kind or id follows, or when the run completes, so a message’s reasoning is reported just ahead of its agent message.

A line that fails to parse as JSON is surfaced as a warning event, as is output on standard error.

RawNormalized
assistant text blockagent, accumulated across same-id fragments and then flushed
assistant thinking blockreasoning, accumulated across same-id fragments and then flushed
user text, redactedThinkingconsumed
toolRequest with its matching toolResponsethe tool’s event, or unknown
completeconsumed for usage, flushing pending text
errorerror
notificationunknown
unrecognized record or block typeunknown

The harness layer captures no session id from Goose’s stream, so harness events from a Goose run carry none.

A toolRequest block is recorded against its call id and resolved when the matching toolResponse arrives. The response’s toolResult.status (success or error) sets the event’s success field. A toolRequest that cannot be parsed becomes an unknown event.

Goose and MCP servers prefix tool names with an extension id such as developer__shell. The name is split on __ and the extension prefix stripped before classification. Tools from the todo extension are consumed as internal session state. The remaining base names map as follows:

Goose toolNormalized event
read, read_imageread; an image’s path comes from its source field
write, editwrite
text_editorread or write by its command: view and read read; write, create, overwrite, edit, str_replace, insert, move, rename, and delete write; anything else is unknown
shellcommand, or a recognized file operation
grep, globsearch
list, treelist
load_skill, skillskill
todo__*consumed as internal session state
any other toolunknown