fix: pass state file path instead of inlining content to avoid Linux E2BIG#4258
fix: pass state file path instead of inlining content to avoid Linux E2BIG#4258marcusquinn merged 1 commit intomainfrom
Conversation
On Linux, execve() enforces MAX_ARG_STRLEN (128KB per argument). The pre-fetched state (135KB+) was inlined into the prompt and passed through two execve() calls: pulse-wrapper → headless-runtime-helper → opencode run Each level hits the same 128KB limit. Instead of inlining the state, pass a reference to the state file (~/.aidevops/logs/pulse-state.txt). The pulse agent reads it via its Read tool — one extra tool call, but the prompt drops from 135KB to ~200 bytes. Works on both Linux and macOS. Closes #4257
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe pulse-wrapper script is refactored to avoid exceeding Linux's per-argument size limit (128KB). Instead of embedding the full pre-fetched state content inline within the prompt argument, the script now references the state file separately and documents the file path with instructions for the agent to read it independently. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical issue on Linux systems where the Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Thu Mar 12 22:09:50 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|
There was a problem hiding this comment.
Code Review
This pull request addresses an E2BIG error on Linux by changing how the pulse state is handled. The content of the state file is no longer inlined as a command-line argument. Instead, the path to the state file is passed in the prompt, with an instruction for the agent to read the file. This change avoids the argument length limit on Linux. The code changes are confined to .agents/scripts/pulse-wrapper.sh and include comments explaining the fix.



Summary
Problem
On Linux,
execve()enforcesMAX_ARG_STRLEN= 128KB per argument. The pre-fetched state (currently 135,606 bytes) was embedded in$promptand passed through twoexecve()calls:pulse-wrapper.sh→headless-runtime-helper.sh --prompt "$prompt"→ E2BIGheadless-runtime-helper.sh→opencode run "$prompt"→ also E2BIGEvery pulse invocation on Linux failed instantly with
Argument list too long, producing only "Starting pulse" log entries. Backfill amplified this to ~120 failed starts per hour.macOS has no per-argument limit (only total ARG_MAX), so this was never hit during development.
Fix
Instead of
cat "$STATE_FILE"into the prompt variable, pass a reference:Prompt drops from 135KB to ~200 bytes. The agent reads the file via its Read tool — one extra tool call per pulse, but:
prefetch_state()creates it)Verification
bash -n: passshellcheck: cleanSTATE_FILEpath unchanged:~/.aidevops/logs/pulse-state.txtCloses #4257
Summary by CodeRabbit