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.
Raw event stream
Section titled “Raw event stream”The stream is made up of four record types:
| Goose record | Handling |
|---|---|
message | A serialized conversation message whose content is an array of blocks (text, thinking, redactedThinking, toolRequest, toolResponse) processed in order. |
notification | Surfaced verbatim as an unknown event rather than parsed from prose. |
error | Becomes an error event. |
complete | The 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.
Normalized mapping
Section titled “Normalized mapping”| Raw | Normalized |
|---|---|
assistant text block | agent, accumulated across same-id fragments and then flushed |
assistant thinking block | reasoning, accumulated across same-id fragments and then flushed |
user text, redactedThinking | consumed |
toolRequest with its matching toolResponse | the tool’s event, or unknown |
complete | consumed for usage, flushing pending text |
error | error |
notification | unknown |
| unrecognized record or block type | unknown |
The harness layer captures no session id from Goose’s stream, so harness events from a Goose run carry none.
Tool mapping
Section titled “Tool mapping”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 tool | Normalized event |
|---|---|
read, read_image | read; an image’s path comes from its source field |
write, edit | write |
text_editor | read 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 |
shell | command, or a recognized file operation |
grep, glob | search |
list, tree | list |
load_skill, skill | skill |
todo__* | consumed as internal session state |
| any other tool | unknown |