fix(cli): update the active standalone binary#1338
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthrough
ChangesVerified CLI updates
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant runUpdateCommand
participant UpdateTarget
participant CLI
User->>runUpdateCommand: request update
runUpdateCommand->>UpdateTarget: detect standalone or npm installation
UpdateTarget->>CLI: install or replace target
runUpdateCommand->>CLI: request --version
CLI-->>runUpdateCommand: return installed version
runUpdateCommand-->>User: report success or remediation
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/cli/src/cli/lib/core-maintenance.ts`:
- Around line 302-307: Update the installer output handling around the
stdout/stderr logging branches and the corresponding lines near the later output
replay so raw captured output is not emitted before version verification
completes. Suppress or sanitize both streams while preserving credential-safe
failure behavior, and ensure no installer output is replayed if verification
fails.
- Around line 292-293: Update npmCliVersionCommand and its caller to use
argv-based execution via spawn or execFile instead of constructing a
shell-quoted command string, preserving the existing version verification
behavior on all platforms. Remove the POSIX quoting dependency from this path
and add a test covering Windows executable/script paths.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 42ade2d4-9be9-45d3-aae3-eef911fda62f
📒 Files selected for processing (4)
CHANGELOG.mdpackages/cli/src/cli/commands/core.test.tspackages/cli/src/cli/commands/core.tspackages/cli/src/cli/lib/core-maintenance.ts
|
ar-relay-review adversarial review — APPROVED ✅ Full diff read line-by-line. All checklist items pass. Key verifications:
Minor non-blocking findings:
Ready for merge. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/cli/src/cli/commands/core.ts`:
- Around line 225-231: Update execFileCommand to enforce a finite timeout when
invoking execFileAsync, so readCliVersion cannot block indefinitely during
agent-relay update. Preserve the existing stdout and stderr normalization while
configuring the timeout through the child-process execution options.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 5bf31268-6e58-465d-aaea-945acb228ad6
📒 Files selected for processing (3)
packages/cli/src/cli/commands/core.test.tspackages/cli/src/cli/commands/core.tspackages/cli/src/cli/lib/core-maintenance.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/cli/src/cli/lib/core-maintenance.ts
Summary
The previous update command always ran npm install globally, even when PATH resolved to a standalone binary, and trusted the installer exit code without checking the active CLI version. Standalone users now update the binary their launcher actually executes; mismatched downloaded or installed versions fail instead of reporting false success.
Fixes #1336
Test Plan
Screenshots
Not applicable; CLI maintenance behavior only.