fix: add timeout to BunProc.run to prevent indefinite hangs#174
Merged
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #173
This commit adds timeout support to the BunProc.run function and the package installation process. The changes prevent indefinite hangs caused by known Bun package manager issues: - HTTP 304 response handling (oven-sh/bun#5831) - Failed dependency fetch (oven-sh/bun#26341) - IPv6 configuration issues Key changes: - Added DEFAULT_TIMEOUT_MS (2 minutes) for subprocess commands - Added INSTALL_TIMEOUT_MS (60 seconds) for package installation - Created TimeoutError for better error handling - Added retry logic for timeout errors (up to 3 attempts) - Added helpful error messages for timeout scenarios The fix ensures that when using --model kilo/glm-5-free, the agent will not hang indefinitely if the bun add command encounters issues. Instead, it will timeout after 60 seconds and retry up to 3 times. Fixes #173 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
--model kilo/glm-5-free is still not workingCo-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This reverts commit 41e6ccf.
Contributor
Author
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
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
This PR adds timeout support to the
BunProc.runfunction to prevent indefinite hangs when using--model kilo/glm-5-free. The issue was thatbun add @openrouter/ai-sdk-provider@latestwould hang forever due to known Bun package manager issues.Changes
DEFAULT_TIMEOUT_MS(2 minutes) for subprocess commandsINSTALL_TIMEOUT_MS(60 seconds) for package installationTimeoutErrorfor better error handling and retry logicRoot Cause Analysis
The hang was caused by known issues in Bun's package manager:
See the full analysis in docs/case-studies/issue-173/CASE-STUDY.md
Test Plan
Bun.spawn()which is documented to kill the process after the specified duration--model kilo/glm-5-free(requires network access to Kilo API)Fixes
Fixes #173
🤖 Generated with Claude Code