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
🤖 Add overflow_policy to prevent git status temp file spam (#256)
Fixes console log spam from background git status polling operations.
## Problem
GitStatusStore and GitStatusIndicator poll git status every 3 seconds.
When output exceeds the 16KB limit, the bash tool writes full output to
temp files, causing console spam:
```
[gitStatus] Script failed: [OUTPUT OVERFLOW - ...]
Full output saved to /var/folders/.../bash-ffe12c1a.txt
```
Background operations don't need full output - they just fail silently.
## Solution
Added `overflow_policy: 'truncate' | 'tmpfile'` configuration option:
- **`'truncate'`** - Returns first 50 lines inline, no temp file (for
background ops)
- **`'tmpfile'`** - Writes full output to temp file (default, for AI
operations)
The option is **NOT exposed to AI** - it's only available through
internal configuration.
## Changes
- Added `overflow_policy?` to `ToolConfiguration` interface
- Updated bash.ts to branch on policy when handling overflow
- Plumbed through IPC types and handlers
- Applied `overflow_policy: 'truncate'` to GitStatusStore and
GitStatusIndicator
## Testing
- Added 2 new tests verifying both policies
- All 504 tests pass
- Verified AI tool schema doesn't expose the parameter
_Generated with `cmux`_
consterrorMessage=`[OUTPUT TRUNCATED - ${overflowReason??"unknown reason"}]\n\nShowing first ${maxTruncateLines} of ${lines.length} lines:\n\n${truncatedOutput}`;
340
332
341
333
resolveOnce({
342
334
success: false,
343
-
error: output,
344
-
exitCode: -1,
345
-
wall_duration_ms,
346
-
});
347
-
}catch(err){
348
-
// If temp file creation fails, fall back to original error
349
-
resolveOnce({
350
-
success: false,
351
-
error: `Command output overflow: ${overflowReason??"unknown reason"}. Failed to save overflow to temp file: ${String(err)}`,
335
+
error: errorMessage,
352
336
exitCode: -1,
353
337
wall_duration_ms,
354
338
});
339
+
}else{
340
+
// tmpfile policy: Save overflow output to temp file instead of returning an error
341
+
// We don't show ANY of the actual output to avoid overwhelming context.
342
+
// Instead, save it to a temp file and encourage the agent to use filtering tools.
343
+
try{
344
+
// Use 8 hex characters for short, memorable temp file IDs
0 commit comments