Repository navigation
fix: use temp file for large prompts instead of CLI args - #101
Merged
Merged
Conversation
c-h-
enabled auto-merge (squash)
March 5, 2026 22:33
c-h-
force-pushed
the
fix/large-prompt-crash
branch
from
March 5, 2026 22:34
c54c490 to
4f2c76f
Compare
When combined --spec/--file content exceeds ~100KB, the prompt inlined into CLI arguments can hit OS argv limits (ARG_MAX), causing the child process to crash silently on launch. For prompts exceeding the threshold, write to a temp file and pass the file descriptor as stdin to the spawned process instead of including the prompt in the argument list. Small prompts continue to use CLI args for backward compatibility. All five adapters (claude-code, opencode, codex, pi, pi-rust) are updated with the same pattern. Fixes #98. Co-Authored-By: Charlie Hulcher <[email protected]>
c-h-
force-pushed
the
fix/large-prompt-crash
branch
from
March 5, 2026 22:52
4f2c76f to
132871d
Compare
c-h-
added a commit
that referenced
this pull request
Mar 6, 2026
New features: - feat: add --file flag to launch command (#95) Bug fixes: - fix: insert -- separator before positional prompt args (#106) - fix: peek/status timeout on opencode sessions (#100) - fix: use temp file for large prompts instead of CLI args (#101) Performance: - perf: use history.jsonl for Claude Code discover(), batch lsof calls (#96) Co-Authored-By: Charlie Hulcher <[email protected]>
Merged
c-h-
added a commit
that referenced
this pull request
Mar 6, 2026
New features: - feat: add --file flag to launch command (#95) Bug fixes: - fix: insert -- separator before positional prompt args (#106) - fix: peek/status timeout on opencode sessions (#100) - fix: use temp file for large prompts instead of CLI args (#101) Performance: - perf: use history.jsonl for Claude Code discover(), batch lsof calls (#96) Co-authored-by: Doink (OpenClaw) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--spec/--filecontent exceeds ~100KB, the prompt inlined into CLI arguments can hit OS argv limits (ARG_MAX), causing the child process to crash silently on launchstdinto the spawned process instead of including the prompt in the argument listFixes #98.
Test plan
npm run typecheckpassesnpm test— all 466 tests passisLargePrompt,writePromptFile,openPromptFd,cleanupPromptFileagentctl launch opencode --spec <large-file> --file <file1> --file <file2>with >100KB combined content🤖 Generated with Claude Code
Co-Authored-By: Charlie Hulcher [email protected]