Repository navigation
fix(cli): default update policy to notify - #3
Open
Dextheking1 wants to merge 1 commit into
Open
Dextheking1 wants to merge 1 commit into
Dextheking1 wants to merge 1 commit into
Conversation
readPolicy fell back to auto when no config set a policy, so a fresh install silently installed new builds. Upstream defaulted to notify. An explicit policy in config is still respected.
Reviewer's guide (collapsed on small PRs)Reviewer's GuideChanges the updater’s no-config fallback from automatic installation to notification, preventing fresh CLI installs from silently replacing the binary while leaving explicit update policies unchanged. Flow diagram for the updater default policyflowchart TD
A["Updater reads configured policy"] --> B{Policy configured?}
B -->|Yes| C["Use explicit policy"]
B -->|No| D["Fallback to notify"]
C --> E{Policy is notify?}
D --> E
E -->|Yes| F["Notify about update"]
E -->|No| G["Follow selected installation policy"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 72 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="packages/cli/src/services/updater.ts" line_range="179" />
<code_context>
),
)
- return values.findLast((value) => value !== undefined) ?? "auto"
+ return values.findLast((value) => value !== undefined) ?? "notify"
})
</code_context>
<issue_to_address>
**Unset updates are not installed**
When no config file sets an update policy, `readPolicy` defaults to `notify`, so `run()` reports an available update without installing it, contradicting the guide’s promise that updates download automatically at startup.
Restore `auto` as the unset-policy default so startup updates are installed as the guide promises.
</issue_to_address>Sourcery assessment
Approved.
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.
Issue for this PR
No linked issue.
Type of change
What does this PR do?
updater
readPolicyfalls back to"auto"when no config file sets a policy.run()treats anything except"notify"as install now, so a fresh install downloads and installs the newest@mars_ai/marscliin the background, no prompt.Upstream defaulted to
"notify"here. This restores that. An explicit policy in config is still respected, only the fallback changes.The CLI holds the user's API key. With the auto fallback, one bad publish replaces the binary on every default install before anyone sees it.
How did you verify your code works?
Verified: one word change.
"notify"is already a valid policy value in this file (decodePolicyaccepts it,run()handles it). Patched updater.ts transpiles clean withbun build.Screenshots / recordings
Not a UI change.
Checklist
Summary by Sourcery
Bug Fixes: