`altimate tool run --json` loses a large answer on a pipe and still exits 0
Description
altimate tool run <tool> --json can exit 0 after writing only part of its JSON to stdout. It happens when the answer is larger than the pipe's buffer (64 KiB on Linux) and the reader falls behind: whatever the pipe hasn't taken when the CLI exits is lost. Anything parsing the output gets invalid JSON with a success exit code.
output is capped, so only metadata gets this big. dbt_lineage with include_graph on a widely connected model is one example.
The Claude Code plugin reads manifests over 4 MiB this way. On an 11 MB manifest (233 models), /lineage said a model that exists doesn't: 4 of 21 tries at a 354 KB answer, 3 of 6 at 495 KB, and 0 of 93 at 231 KB or less. In real edits on the 354 KB model, 3 of 10 lost the plugin's impact note.
Plugins
altimate-claude-plugin 1.4.0, which is where this showed up. It reproduces without the plugin.
OpenCode version
0.12.9
Steps to reproduce
- Take a manifest with a model whose lineage answer is well over 64 KiB.
- Run
altimate tool run dbt_lineage --args '{"manifest_path":"target/manifest.json","model":"<model>","include_graph":true}' --json | wc -c. - Run the same command with
> out.json, thenwc -c out.json.
On a 354,156-byte answer, the file gets all of it and the pipe got 229,376 bytes. The count varies from run to run.
Screenshot and/or share link
Not applicable.
Resolved in v0.12.10.