fix: prevent E2BIG error in Claude Code provider #9760
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.
This PR fixes issue #9759 where the Claude Code provider crashes with an E2BIG error when Codebase Indexing is active.
Problem
When Codebase Indexing is enabled, the system prompt becomes very large and exceeds the OS ARG_MAX limit (typically ~128KB on Linux/Mac) when passed as a command-line argument, causing a spawn E2BIG error.
Solution
Modified the
runProcessfunction to always pass the system prompt via stdin on all platforms, not just Windows. This prevents the E2BIG error by avoiding command-line argument size limits.Changes Made:
src/integrations/claude-code/run.tsto always pass system prompt via stdinsrc/integrations/claude-code/__tests__/run.spec.tsto reflect the new unified behaviorTechnical Details:
Fixes #9759
Important
Fix E2BIG error in Claude Code provider by passing system prompt via stdin on all platforms.
runProcessinrun.tsto pass system prompt and messages via stdin on all platforms, preventing E2BIG errors.run.spec.tstests to ensure system prompt is not passed as a command-line argument on any platform.run.tsfor ENOENT errors withcreateClaudeCodeNotFoundError().run.ts.run.spec.tsto test stdin behavior across platforms and error scenarios.This description was created by
for e76d64f. You can customize this summary. It will automatically update as commits are pushed.