Repository navigation
chore: rolling promotion dev -> main - #2555
Conversation
…onvergence fix(codex): setup repair converges marketplace root and plugin version
docs(wishes): agent-sync stable-leg QA evidence — iteration 4 clean
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughPlugin versions are bumped to ChangesCodex repair convergence
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant installCodexIntegration
participant addCodexMarketplace
participant CodexCLI
participant verifyCodexPluginCurrent
installCodexIntegration->>addCodexMarketplace: register canonical marketplace root
addCodexMarketplace->>CodexCLI: inspect and repair automagik marketplace
installCodexIntegration->>verifyCodexPluginCurrent: verify genie@automagik version
verifyCodexPluginCurrent->>CodexCLI: remove and reinstall stale plugin
CodexCLI-->>installCodexIntegration: return converged or stuck state
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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.
Code Review
This pull request bumps the project version to 5.260711.5 and implements logic to handle codex repair convergence, specifically addressing stale marketplace roots and stale installed plugins. It introduces functions to repoint the marketplace if it points to a different source and to reinstall the plugin if its version does not match the CLI version, along with corresponding unit tests. The reviewer identified a potential issue in verifyCodexPluginCurrent where a failed re-installation could leave the plugin uninstalled without throwing an error, and provided a code suggestion to explicitly assert that the plugin is installed.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| if (state.installed && state.version !== VERSION) { | ||
| throw new Error(`codex plugin stuck at v${state.version} (CLI v${VERSION}) — marketplace root may be stale`); | ||
| } |
There was a problem hiding this comment.
If the re-installation of the plugin fails or does not register (i.e., state.installed becomes false after running plugin add), the current check state.installed && state.version !== VERSION will evaluate to false and silently succeed. This leaves the plugin completely uninstalled without throwing an error. We should explicitly assert that the plugin is installed after the re-installation attempt.
| if (state.installed && state.version !== VERSION) { | |
| throw new Error(`codex plugin stuck at v${state.version} (CLI v${VERSION}) — marketplace root may be stale`); | |
| } | |
| if (!state.installed) { | |
| throw new Error('codex plugin genie@automagik is not installed after re-installation attempt'); | |
| } | |
| if (state.version !== VERSION) { | |
| throw new Error('codex plugin stuck at v' + state.version + ' (CLI v' + VERSION + ') — marketplace root may be stale'); | |
| } |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 044c1bcd6c
ℹ️ 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".
| runChecked(runner, 'codex', ['plugin', 'remove', 'genie@automagik', '--json'], true); | ||
| runChecked(runner, 'codex', ['plugin', 'add', 'genie@automagik', '--json']); |
There was a problem hiding this comment.
Preserve disabled state when Codex repair fails
When a user had an older genie@automagik install explicitly disabled, any failure after this remove/add repair (for example plugin add fails, or the re-verify throws because the marketplace still serves the stale version) is caught by installRuntimeIntegrations before line 282 restores enabled = false. The Codex CLI reference documents plugin remove as deleting the installed plugin from local config/cache and plugin add as installing it again, so a failed repair can leave a user-disabled plugin removed or re-enabled while reporting ok: false; preserve/restore the prior disabled setting in a finally or rollback path around the repair.
Useful? React with 👍 / 👎.
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 `@src/lib/runtime-integrations.test.ts`:
- Around line 140-142: Track each directory created by makeCodexHome in a shared
collection, and add an afterEach cleanup for this test describe block that
removes all tracked temporary directories and resets the collection. Reuse the
existing afterEach import and preserve makeCodexHome’s return behavior.
In `@src/lib/runtime-integrations.ts`:
- Around line 267-270: Update the post-repair validation around state and the
installed/version check to throw when state.installed is false or when the
installed plugin version differs from VERSION. Preserve the existing
stale-version error context and ensure installCodexIntegration cannot report
success unless the plugin is present at the expected version.
🪄 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: bc9c6dbb-a616-44e9-a929-58583a041dee
📒 Files selected for processing (8)
.claude-plugin/marketplace.json.genie/wishes/agent-sync/qa/live-ritual-20260710.mdpackage.jsonplugins/genie/.claude-plugin/plugin.jsonplugins/genie/.codex-plugin/plugin.jsonplugins/genie/package.jsonsrc/lib/runtime-integrations.test.tssrc/lib/runtime-integrations.ts
| function makeCodexHome(): string { | ||
| return mkdtempSync(join(tmpdir(), 'genie-codex-home-')); | ||
| } |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Temp dirs created by makeCodexHome are never cleaned up.
The coding guidelines for **/*.test.ts require "tmpdir fixtures with cleanup in afterEach." makeCodexHome() calls mkdtempSync but the paths aren't tracked or removed, leaking directories on every test run. afterEach is already imported but not used in this describe block.
As per coding guidelines, **/*.test.ts files should "Use tmpdir fixtures with cleanup in afterEach."
♻️ Proposed fix: track dirs and clean up in afterEach
describe('codex repair convergence (stale marketplace root / stale installed plugin)', () => {
+ const codexHomes: string[] = [];
+
const staleList = JSON.stringify({
installed: [{ pluginId: 'genie@automagik', enabled: true, version: '5.260710.9' }],
});
const currentList = JSON.stringify({
installed: [{ pluginId: 'genie@automagik', enabled: true, version: VERSION }],
});
function makeCodexHome(): string {
- return mkdtempSync(join(tmpdir(), 'genie-codex-home-'));
+ const dir = mkdtempSync(join(tmpdir(), 'genie-codex-home-'));
+ codexHomes.push(dir);
+ return dir;
+ }
+
+ afterEach(() => {
+ for (const dir of codexHomes) {
+ rmSync(dir, { recursive: true, force: true });
+ }
+ codexHomes.length = 0;
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| function makeCodexHome(): string { | |
| return mkdtempSync(join(tmpdir(), 'genie-codex-home-')); | |
| } | |
| const codexHomes: string[] = []; | |
| function makeCodexHome(): string { | |
| const dir = mkdtempSync(join(tmpdir(), 'genie-codex-home-')); | |
| codexHomes.push(dir); | |
| return dir; | |
| } | |
| afterEach(() => { | |
| for (const dir of codexHomes) { | |
| rmSync(dir, { recursive: true, force: true }); | |
| } | |
| codexHomes.length = 0; | |
| }); |
🤖 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 `@src/lib/runtime-integrations.test.ts` around lines 140 - 142, Track each
directory created by makeCodexHome in a shared collection, and add an afterEach
cleanup for this test describe block that removes all tracked temporary
directories and resets the collection. Reuse the existing afterEach import and
preserve makeCodexHome’s return behavior.
Source: Coding guidelines
| state = codexPluginState(runChecked(runner, 'codex', ['plugin', 'list', '--json']).stdout); | ||
| if (state.installed && state.version !== VERSION) { | ||
| throw new Error(`codex plugin stuck at v${state.version} (CLI v${VERSION}) — marketplace root may be stale`); | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Post-repair check misses !state.installed case.
After the remove+re-add repair, the condition state.installed && state.version !== VERSION returns silently if state.installed is false. If plugin add returned exit 0 but the plugin isn't listed (CLI bug, parsing mismatch, or stale marketplace), the function exits without throwing and installCodexIntegration reports ok: true — a silent failure where the user believes the plugin converged when it didn't.
🐛 Proposed fix: also throw when plugin is not installed after repair
- if (state.installed && state.version !== VERSION) {
- throw new Error(`codex plugin stuck at v${state.version} (CLI v${VERSION}) — marketplace root may be stale`);
+ if (!state.installed || state.version !== VERSION) {
+ throw new Error(
+ `codex plugin ${state.installed ? `stuck at v${state.version}` : 'not installed after repair'} (CLI v${VERSION}) — marketplace root may be stale`,
+ );
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| state = codexPluginState(runChecked(runner, 'codex', ['plugin', 'list', '--json']).stdout); | |
| if (state.installed && state.version !== VERSION) { | |
| throw new Error(`codex plugin stuck at v${state.version} (CLI v${VERSION}) — marketplace root may be stale`); | |
| } | |
| state = codexPluginState(runChecked(runner, 'codex', ['plugin', 'list', '--json']).stdout); | |
| if (!state.installed || state.version !== VERSION) { | |
| throw new Error( | |
| `codex plugin ${state.installed ? `stuck at v${state.version}` : 'not installed after repair'} (CLI v${VERSION}) — marketplace root may be stale`, | |
| ); | |
| } |
🤖 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 `@src/lib/runtime-integrations.ts` around lines 267 - 270, Update the
post-repair validation around state and the installed/version check to throw
when state.installed is false or when the installed plugin version differs from
VERSION. Preserve the existing stale-version error context and ensure
installCodexIntegration cannot report success unless the plugin is present at
the expected version.
Co-Authored-By: metrics-updater <noreply@automagik.dev>
Rolling Promotion PR
Auto-maintained rolling promotion PR from
devtomain.Process:
ready-to-mergeadded when all checks passSummary by CodeRabbit