execute_command output is saved to disk so nothing is lost, and the agent gets a preview plus a path to read the full log.
Quick Start
Default (spill is already on)
No code change is required — spill is enabled by default.When the test log overflows, the tool result includes a
stdout_artifact path — the agent reads that file for the failing traceback that used to be truncated away.How It Works
| Step | What happens |
|---|---|
| 1 | Command runs and produces output |
| 2 | Output within max_output_size returns inline with zero overhead |
| 3 | Over-budget output is written in full to a disk artifact |
| 4 | The result keeps a head/tail preview plus a pointer to the artifact |
| 5 | The agent reads the artifact with read_file or grep |
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
spill | bool | True | Persist over-budget output to a retrievable artifact instead of dropping the middle. |
spill_dir | Optional[str] | None | Directory for artifacts. Overrides the env var. |
max_output_size | int | 10000 | Byte/char budget for the inline preview. |
PRAISONAI_TOOL_OUTPUT_DIR | env | system temp | Fallback dir when spill_dir isn’t passed. Set this for cross-session retrieval. |
spill_dir argument, then PRAISONAI_TOOL_OUTPUT_DIR, then <system temp>/praisonai_tool_output/.
Result-dict fields
stdout_artifact and stderr_artifact (absolute paths) appear only when overflow occurs with spill=True.What the Agent Sees
When spill fires, the preview keeps the head and tail with a pointer line in the middle:Retrieval
The agent reads the omitted region straight from the artifact path.Best Practices
Keep the default (spill=True)
Keep the default (spill=True)
The buried middle is where errors live — a failing assertion or stack trace hides inside verbose build/test output.
Use PRAISONAI_TOOL_OUTPUT_DIR for cross-session retrieval
Use PRAISONAI_TOOL_OUTPUT_DIR for cross-session retrieval
Set a workspace-scoped dir to keep artifacts across runs; leave it unset for auto-cleanup on process exit.
Set spill=False only for strict legacy compatibility
Set spill=False only for strict legacy compatibility
Opt out only when a caller pins the old middle-truncated preview with no persistence.
Don't spill secret-bearing outputs
Don't spill secret-bearing outputs
Artifacts are plaintext on disk — avoid commands that print credentials or tokens.
Related
Shell Agent
Run shell commands with
execute_commandTool Output Store
Recover full outputs for arbitrary tool return values
Context Per-Tool Budgets
Per-tool truncation limits

