Open Agent Loops
API Reference

formatShellResult

@open-agent-loops/core


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

ParameterTypeDescription
resultShellResultThe 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)".

See

shellTool

On this page