-
Notifications
You must be signed in to change notification settings - Fork 183
Auto-update requirements after maintenance fixes #1578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughhasRequirements now classifies any missing or out-of-date core/manager package as Changes
Sequence Diagram(s)(Skipped — changes are multiple but do not introduce a new multi-component sequential feature that warrants a diagram.) Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR changes the error handling behavior for virtual environment requirements validation. When requirements are missing or incomplete and don't match known upgrade patterns, the code now returns 'error' instead of 'package-upgrade'.
Changes:
- Modified return value from 'package-upgrade' to 'error' for non-OK requirements that don't match known upgrade patterns
- Updated log message and level (info → warn) to reflect the new error classification
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/virtualEnvironment.ts
Outdated
| log.warn('Requirements are missing or out of date. Treating as error.', { | ||
| coreOk, | ||
| managerOk, | ||
| upgradeCore, | ||
| upgradeManager, | ||
| }); | ||
| return 'package-upgrade'; | ||
| return 'error'; |
Copilot
AI
Jan 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change modifies the behavior in comfyInstallation.ts where 'package-upgrade' is treated as OK with a warning (lines 168-170). After this change, cases that previously returned 'package-upgrade' will now return 'error', which will be treated as a genuine error (lines 172-173) instead of OK with a warning.
This is a breaking behavioral change that affects the validation flow. Previously, unknown missing packages were tolerated as a warning; now they will be treated as errors. Consider whether this is the intended behavior and ensure it's properly documented and that any downstream consumers are updated accordingly.
src/virtualEnvironment.ts
Outdated
|
|
||
| if (!coreOk || !managerOk) { | ||
| log.info('Requirements are out of date. Treating as package upgrade.', { | ||
| log.warn('Requirements are missing or out of date. Treating as error.', { |
Copilot
AI
Jan 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The log message "Requirements are missing or out of date. Treating as error." is potentially misleading. This code path is reached when requirements are NOT OK AND do not match known upgrade patterns. It's not necessarily about being "out of date" - it could be truly missing packages or unexpected package changes.
Consider clarifying the log message to be more precise, such as "Requirements check failed with unknown or unexpected package changes. Treating as error." This would better distinguish it from the known upgrade cases that are handled at lines 966-968.
| log.warn('Requirements are missing or out of date. Treating as error.', { | |
| log.warn('Requirements check failed with unknown or unexpected package changes. Treating as error.', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 024652d33f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/virtualEnvironment.ts (1)
883-889:⚠️ Potential issue | 🟠 MajorUpdate JSDoc and fix call site logic to distinguish
'package-upgrade'from'error'.The JSDoc still references the outdated
'manager-upgrade'value instead of the current'package-upgrade'return type. Additionally, the call site at line 324 incorrectly treats'package-upgrade'(known safe upgrades) the same as'error'(unexpected missing packages) by callingmanualInstall()for both. Only'error'should trigger a manual install;'package-upgrade'should allow the application to proceed (similar to the comfyInstallation.ts:167 call site behavior).Update the JSDoc to accurately reflect the three return values and their semantics, and fix the logic at line 326 to handle
'package-upgrade'and'error'separately:Suggested changes
- Lines 887-889 — Update JSDoc:
- * `@returns` `'OK'` if pip install does not detect any missing packages, - * `'manager-upgrade'` if `uv` and `toml` are missing, - * or `'error'` when any other combination of packages are missing. + * `@returns` `'OK'` if all required packages are installed and up to date, + * `'package-upgrade'` if missing packages match a known safe upgrade pattern, + * or `'error'` for any other missing or unexpected package combination.
- Lines 326-331 — Handle
'package-upgrade'separately from'error':if (requirementsStatus === 'OK') { log.info('Skipping requirements installation - all requirements already installed'); + } else if (requirementsStatus === 'package-upgrade') { + log.info('Known package upgrade detected - proceeding with installation'); - } else { + } else if (requirementsStatus === 'error') { log.info('Starting manual install - venv missing requirements'); await this.manualInstall(callbacks); }
benceruleanlu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed review feedback: removed allow‑list gating to preserve auto‑update for any mismatch, reset now installs requirements, tests updated, docs/logs aligned.
Summary
Why
Resetting the venv should not silently bundle a full requirements install. Instead, we now re‑run validation after maintenance actions and, if requirements are out of date, trigger the standard auto‑update path. This preserves the default auto‑update behavior for new dependencies while keeping the maintenance UX consistent.
UX Behavior
Testing
yarn formatyarn lintyarn typecheckyarn test:unitNotes
Summary by CodeRabbit
Bug Fixes
Refactor
Tests
✏️ Tip: You can customize this high-level summary in your review settings.