You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bash output truncation is head-only, discarding the tail where build and test errors live #764
source/tools/execute-bash.tsx:50-54 truncates bash output for the LLM by keeping the first 2000 characters and discarding everything after:
constllmContext=fullOutput.length>TRUNCATION_OUTPUT_LIMIT
? fullOutput.substring(0,TRUNCATION_OUTPUT_LIMIT)+'\n... [Output truncated. Use more specific commands to see full output]'
: fullOutput;
Compiler and test-runner output puts the important part at the end:
tsc prints the error list, then the count
AVA prints passing output, then the failure summary
most build tools print the exit status and error digest last
So head-truncating a pnpm run test:types or pnpm run test:ava run throws away exactly the part the model needs. It then has to re-run with a narrower command to recover information we already had in hand, which costs an extra step and an extra full round-trip.
Fix
Head plus tail with an elision marker. Same byte budget, much higher information density:
Tail should get the larger share, since that is where the actionable content usually is.
Also worth revisiting whether TRUNCATION_OUTPUT_LIMIT (2000 chars, source/constants.ts:80) is the right budget for build output. That is roughly 500 tokens, which is tight for a failing typecheck.
Note the same constant is used by source/custom-tools/handler.ts:100-101 with the same head-only behaviour, and by source/components/bash-progress.tsx:88 for display (where head-only is arguably fine). A shared head-plus-tail helper would cover the first two.
Notes for a first-time contributor
Self-contained change to one function plus a small shared helper. Tests in source/tools/execute-bash.spec.tsx.
Activity
will-lamerton commentedon Aug 3, 2026
Part of #772.
fix: truncate LLM-facing command output head+tail instead of head-only
fix: truncate LLM-facing command output head+tail instead of head-only
fix: truncate LLM-facing command output head+tail instead of head-only