Promote dev to stable: PM2 Genie install recovery - #2476
Conversation
📝 WalkthroughWalkthroughPatch version 4.260522.9 strengthens PM2 process health validation during install and improves health-unreachable error messages. The install command now conditionally early-returns only for "reusable" processes (online with valid PID), otherwise deletes and reinstalls. Health-unreachable messages now guide users through PM2 restart with environment fallback to full reinstall. ChangesPM2 Process Health Checking and Install Remediation
Version Bump to 4.260522.9
🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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.
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 `@package.json`:
- Line 3: The version bump in package.json ("version": "4.260522.9") must be
blocked until Binary SHA Drift is resolved; revert or hold this version change
and update the pinned binarySha256 entries in the manifest to match the actual
build artifacts, and fix the unknown asset-prefix handling code that generates
incorrect asset names so the computed SHAs match expectations; locate references
to "version" in package.json, the manifest field binarySha256, and the
asset-prefix normalization logic (search for functions/variables handling
asset-prefix or asset name generation) and correct the prefix handling, re-run
the SHA computation, and only then promote the version bump.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 569f4181-bd24-4749-8b26-47a3ef96dceb
📒 Files selected for processing (8)
.claude-plugin/marketplace.jsonpackage.jsonplugins/genie/.claude-plugin/plugin.jsonplugins/genie/package.jsonsrc/genie-commands/__tests__/install.test.tssrc/genie-commands/__tests__/update.test.tssrc/genie-commands/install.tssrc/genie-commands/update.ts
| { | ||
| "name": "@automagik/genie", | ||
| "version": "4.260522.8", | ||
| "version": "4.260522.9", |
There was a problem hiding this comment.
Block release bump until SHA drift is resolved.
4.260522.9 should not be promoted while Binary SHA Drift is failing; this breaks release integrity checks tied to binarySha256 in this manifest. Update pinned SHA(s) and fix the unknown asset-prefix handling before merging this version bump.
🧰 Tools
🪛 GitHub Actions: Binary SHA Drift / drift-check
[error] SHA drift detected for pinned binarySha256 asset (message: "SHA drift for $asset"). Upstream binary SHA256 does not match the pinned value in package.json.
[warning] Unknown asset prefix '$asset' — skipping drift check for this asset (extend drift check to support it).
🤖 Prompt for 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.
In `@package.json` at line 3, The version bump in package.json ("version":
"4.260522.9") must be blocked until Binary SHA Drift is resolved; revert or hold
this version change and update the pinned binarySha256 entries in the manifest
to match the actual build artifacts, and fix the unknown asset-prefix handling
code that generates incorrect asset names so the computed SHAs match
expectations; locate references to "version" in package.json, the manifest field
binarySha256, and the asset-prefix normalization logic (search for
functions/variables handling asset-prefix or asset name generation) and correct
the prefix handling, re-run the SHA computation, and only then promote the
version bump.
There was a problem hiding this comment.
Code Review
This pull request updates the project version to 4.260522.9 and introduces logic to identify and automatically recreate non-reusable PM2 processes during the installation phase. It also refactors PM2 process deletion into a dedicated helper function and enhances the remediation instructions displayed when a health check fails. A review comment suggests renaming a function parameter to avoid shadowing the global Node.js process object, which would improve code clarity and maintainability.
| pm2_env?: { status?: string }; | ||
| } | ||
|
|
||
| function isReusableCanonicalPm2Process(process: Pm2Process | null): boolean { |
There was a problem hiding this comment.
The parameter name process shadows the global process object in Node.js. While TypeScript allows this, it is a common source of confusion and potential bugs if someone later tries to access global properties like process.env or process.exit() within this function. Consider renaming it to pm2Process or proc to improve maintainability and clarity.
| function isReusableCanonicalPm2Process(process: Pm2Process | null): boolean { | |
| function isReusableCanonicalPm2Process(pm2Process: Pm2Process | null): boolean { | |
| if (!pm2Process) return false; | |
| if (pm2Process.pm2_env?.status !== 'online') return false; | |
| return typeof pm2Process.pid === 'number' && pm2Process.pid > 0; | |
| } |
Promotes dev to stable for the PM2 Genie install recovery fix.\n\nIncluded fix:\n- Recreate unhealthy PM2
Genieentries duringgenie installinstead of treatingwaiting restart/ non-online entries as already installed.\n- Improve update diagnostic remediation for recurringGenie server unreachableafter update.\n\nEvidence:\n- Commit: 776ea68fix: recreate unhealthy pm2 genie install\n- Dev release: v4.260522.9\n- Dev CI: success\n- Commitlint: success\n- Release v4.260522.9: success\n\nLocal runtime verification on genie-khal-hermes:\n-genie --version= 4.260522.8\n- PM2Genierecreated and online\n-~/.genie/serve.pidpresent\n-genie serve statusreports running, pgserve healthy, hook UDS listening, scheduler integrated\nSummary by CodeRabbit
Release Notes
Chores
Bug Fixes