fix: prevent terminal corruption during background bun install#2451
Merged
code-yeongyu merged 4 commits intodevfrom Mar 11, 2026
Merged
fix: prevent terminal corruption during background bun install#2451code-yeongyu merged 4 commits intodevfrom
code-yeongyu merged 4 commits intodevfrom
Conversation
There was a problem hiding this comment.
1 issue found across 4 files
Confidence score: 3/5
- There is a concrete regression risk in
src/cli/config-manager/bun-install.ts: the timeout handler still awaits process exit, which can permanently hang if the child process is stuck. - Because this is a high-severity, high-confidence issue (7/10, 9/10) affecting timeout safety in CLI install flow, merge risk is moderate rather than minimal.
- Pay close attention to
src/cli/config-manager/bun-install.ts- timeout logic can block indefinitely instead of failing fast.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/cli/config-manager/bun-install.ts">
<violation number="1" location="src/cli/config-manager/bun-install.ts:106">
P1: Awaiting process exit unconditionally inside the timeout handler defeats the timeout's protection. If the process is stuck, this causes a permanent hang.
To safely log the output without blocking the timeout return, handle the promise asynchronously.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
30391ea to
de2b073
Compare
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
devrunBunInstallWithDetails()so backgroundbun installno longer inherits the active terminal outputTesting
bun test src/cli/config-manager/bun-install.test.ts src/hooks/auto-update-checker/hook/background-update-check.test.tsbun run typecheckbun run buildFixes #2238
Summary by cubic
Prevents terminal corruption by running background
bun installin silent pipe mode. Adds output control torunBunInstallWithDetails()and updates the auto-update checker to use it, surfacing captured logs only on failure or timeout.outputMode("inherit" | "pipe", default "inherit") torunBunInstallWithDetails(); inpipemode, capture stdout/stderr via Bun stream-to-text.exited, and returntimedOut: truewith a clear error.runBunInstallWithDetails({ outputMode: "pipe" })and logs failure messages.Written for commit de2b073. Summary will update on new commits.