Repository navigation
Turn off the Codex plugin for the connector's Claude turns - #1059
Merged
Merged
Conversation
An orchestrator that had run for three days stopped being able to start any shell command, even `echo hi`: "command line plus environment exceed the OS exec argument limit (E2BIG)". OpenAI's Codex plugin appends three exports to the session's env file on every SessionStart, and each `claude -p --resume` turn is one. Claude Code inlines that file into the single `bash -c` argument of every Bash call. After 375 turns the file was 133.5 KB, past Linux's 128 KiB limit on one argument, so nothing could run. Restarting the connector didn't help, because it resumes the same session and the file belongs to it. Every Claude turn the connector starts, orchestrator and worker, now passes --settings turning that one plugin off. --settings merges over the person's own settings, so their other plugins stay on, and Codex stays on in their own sessions.
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Recovery under a live connector remains unverified for sessions already broken by E2BIG, since preventing new hook writes does not establish that resuming stops inlining the existing oversized environment file.
No open issues 🎉
What changed in this PR
This PR prevents further session-environment growth from OpenAI’s Codex plugin during long-running connector Claude sessions, avoiding shell failures caused by argument-size limits.
Changes:
- Disables
codex@openai-codexfor every connector-managed Claude turn while preserving other plugins and personal sessions. - Updates argument assertions for worker, resumed orchestrator, and guarded turns.
[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or rungh pr ready --undo.
Click "Ready for review" or rungh pr readyto reengage.
| File | Description |
|---|---|
internal/connector/runner/adapter.go |
Adds per-turn settings to disable the Codex plugin and documents why. |
internal/connector/runner/adapter_test.go |
Updates Claude argument assertions to require the settings override. |
Review effort: Balanced
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.
Why
An orchestrator that had run for three days stopped being able to run any shell command, even
echo hi. Every Bash call failed with "command line plus environment exceed the OS exec argument limit (E2BIG)". It couldn't send work to workers or reply in Basecamp, and restarting the connector didn't help.The cause is OpenAI's Codex plugin. Its SessionStart hook appends three
exportlines to the session's env file every time, and eachclaude -p --resumeturn the connector runs counts as a SessionStart. Claude Code pastes that file into the singlebash -cargument of every Bash call. After 375 turns the file was 133.5 KB, past Linux's 128 KiB limit on one argument. A restart resumes the same session, and the file belongs to that session, so it stayed broken.What
Every Claude turn the connector starts, orchestrator and worker, now passes:
--settingsmerges over the person's own settings, so only that plugin is off. Their other plugins still load, and Codex stays on in their own sessions.Nothing to do for anyone running the connector beyond upgrading.
Testing
make checkpasses (linted with golangci-lint v2.11.1, the version CI uses)claude -pwith and without the flag. With it, the Codex plugin and its skills don't load, its hook writes nothing to the session's env file, and the other plugins load as usual. Without it, the hook writes its exports.Summary by cubic
Fixes shell commands failing with E2BIG after days of continuous running by disabling OpenAI's Codex plugin on the connector's Claude turns.
The Codex plugin appends its exports to the session env file on every SessionStart, and each
claude -p --resumeturn counts as one. After 375 turns the file grew past Linux's 128 KiB limit per argument, so no Bash command could start. Restarting the connector did not help because it resumes the same session, and the oversized file belongs to it.Every Claude turn — orchestrator and worker — now passes
--settingsto turn off that one plugin. The setting merges over the person's own settings, so their other plugins load normally and Codex stays on in their own sessions.Written for commit d86d4c7. Summary will update on new commits.