API Reference
formatShellResult
function formatShellResult(result): string;Defined in: tools/builtin/shell.ts:68
Fold a ShellResult into the single text result the loop hands to the model.
Parameters
| Parameter | Type | Description |
|---|---|---|
result | ShellResult | The stdout/stderr/exit code captured by a ShellBackend. |
Returns
string
A text block combining stdout, an annotated stderr section, and the exit code when non-zero.
Remarks
A non-zero exit is NOT a tool error (the command ran) — it is surfaced in the
content so the model can react, with stderr and the exit code shown only when
they carry signal. Empty output yields "(no output)".