When a large file is included in the staged diff, git-ai-commit fails in a way that gives the user no actionable information.
Observed behavior
The per-file diff truncation (100 lines per file by default) is working, but many staged files each truncated to 100 lines can still produce a prompt large enough to overflow the engine's context window. When that happens, the engine subprocess exits with a non-zero status and the error surfaced to the user is unhelpful.
Two failure modes confirmed with real engines:
Claude — exits with code 1, empty stderr:
engine command failed: exit status 1:
No useful information is given.
Codex — exits with code 1, but stderr contains the entire prompt echoed back by Codex (including the full diff), followed by the actual error buried at the very end:
engine command failed: exit status 1: Reading prompt from stdin...
OpenAI Codex v0.111.0 (research preview)
...
+0123456789abcdef...
+0123456789abcdef...
[hundreds of diff lines]
...
... [1m_lines.txt truncated: showing 100 of 12945 lines]
[Filter notice: Truncated files: 1m_lines.txt]
=== OUTPUT ===
ERROR: Codex ran out of room in the model's context window.
Start a new thread or clear earlier history before retrying.
The actual error is invisible without scrolling through the entire dump.
Impact
In both cases, the user cannot tell:
- Why the tool failed
- Which file(s) caused the overflow
- What to do next
The tool appears to fail silently (Claude) or produce an unreadable wall of text (Codex), with no actionable guidance either way.
When a large file is included in the staged diff,
git-ai-commitfails in a way that gives the user no actionable information.Observed behavior
The per-file diff truncation (100 lines per file by default) is working, but many staged files each truncated to 100 lines can still produce a prompt large enough to overflow the engine's context window. When that happens, the engine subprocess exits with a non-zero status and the error surfaced to the user is unhelpful.
Two failure modes confirmed with real engines:
Claude — exits with code 1, empty stderr:
No useful information is given.
Codex — exits with code 1, but stderr contains the entire prompt echoed back by Codex (including the full diff), followed by the actual error buried at the very end:
The actual error is invisible without scrolling through the entire dump.
Impact
In both cases, the user cannot tell:
The tool appears to fail silently (Claude) or produce an unreadable wall of text (Codex), with no actionable guidance either way.