Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository 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)
📝 WalkthroughWalkthroughThe change adds TOML parsing and marketplace metadata promotion for matching marketplaces with newer valid runtime timestamps. It preserves formatting and unrelated configuration, removes runtime-only marketplace sections during canonical configuration creation, and applies optional revision updates. Configuration synchronization now uses the complete runtime configuration and writes only when prepared content changes. New Vitest coverage verifies promotion, idempotency, timestamp validation, identity matching, and marketplace retention behavior. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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.
🧹 Nitpick comments (2)
src/main/codex/config-settings-promotion.ts (1)
235-237: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winAvoid reading
runtimeTomlPathtwice per promotion pass.
readPromotedSettingValues(runtimeTomlPath)(line 235) already reads the file internally. Line 237 reads the same path again to get the raw string. This doubles I/O onruntimeTomlPathon every promotion pass. It can also letruntimeValuesandruntimeConfigreflect two different snapshots of the file if a concurrent write happens between the two reads, since the runtimeconfig.tomlcan be modified by a running Codex CLI process.Read the file once and derive both the structured values and the raw content from the same read.
♻️ Proposed refactor to read the runtime file once
- const runtimeValues = readPromotedSettingValues(runtimeTomlPath) - const systemValues = readPromotedSettingValues(systemTomlPath) - const runtimeConfig = readAgentStateFileSync(runtimeTomlPath) + const runtimeConfig = readAgentStateFileSync(runtimeTomlPath) + const runtimeValues = readPromotedSettingValuesFromContent(runtimeConfig) + const systemValues = readPromotedSettingValues(systemTomlPath)This requires extracting the line-scanning body of
readPromotedSettingValuesinto areadPromotedSettingValuesFromContent(content: string)helper, withreadPromotedSettingValues(configPath)calling it after its own read.src/main/codex/config-marketplace-refresh-promotion.test.ts (1)
128-207: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a regression test for promoting multiple marketplaces independently.
The PR objectives call for covering "multiple marketplaces" alongside idempotency and identity matching. All tests here exercise a single
[marketplaces.demo]table. Add a case with two marketplace tables in the same config where only one has a newer, matching runtime timestamp, and assert that only the eligible one is promoted while the other's canonical metadata stays untouched. This also exercises the bottom-up line-splice ordering inpromoteMarketplaceRefreshMetadatawhen both tables need alast_revisionline inserted.Do you want me to draft this test case?
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 2ebf93f4-466b-42b3-bbc4-ebb067699fa5
📒 Files selected for processing (3)
src/main/codex/config-marketplace-refresh-promotion.test.tssrc/main/codex/config-marketplace-refresh-promotion.tssrc/main/codex/config-settings-promotion.ts
Greptile SummaryThis PR introduces
Confidence Score: 5/5Safe to merge — the change is self-contained to the Codex config promotion path and introduces no new filesystem authority, credentials, or network access. The identity gate, timestamp comparison, CRLF handling, and multi-table splice ordering are all correct. The fail-closed behavior for unparseable multi-line arrays is intentional and documented. The mkdirSync relocation is a clean fix to a prior review finding, and the test suite covers the key scenarios including idempotency and the last_revision splice path. Files Needing Attention: No files require special attention.
|
| Filename | Overview |
|---|---|
| src/main/codex/config-marketplace-refresh-promotion.ts | New module: parses marketplace TOML sections, gates promotion on identity equality and strict timestamp ordering, handles CRLF, and inserts last_revision when absent. Logic is sound with correct descending-sort guard for multi-table splices. |
| src/main/codex/config-settings-promotion.ts | Refactored to delegate to prepareSystemConfigForPromotion; mkdirSync calls correctly moved below the nextContent === null / unchanged early-return; no existing semantics broken. |
| src/main/codex/config-marketplace-refresh-promotion.test.ts | Integration tests cover promotion (with idempotency), equal/older/malformed/missing timestamps, identity-change preservation, last_revision splice insertion (with CRLF pin), and runtime-only marketplace exclusion. |
Reviews (2): Last reviewed commit: "docs(codex): note why an unparsed sparse..." | Re-trigger Greptile
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Thank you for this — you are credited as a co-author on the commit that landed. Your marketplace rule is substantively the one that merged: match the source identity first, then promote only on a strictly newer timestamp. You handled more than the happy path — stale and malformed values both skip, and gating on identity so a marketplace whose source moved keeps canonical in control is exactly right. Your array-aware Two notes for the record. The merged version differs on one edge: when canonical has no parseable Closing as superseded by #20150. The reason it needed to be one change rather than two: a metadata-only policy only rewrites fields inside marketplaces that already exist on both sides, so a marketplace registered from inside Orca is never promoted and still disappears — that is #10489, and it is now an explicit discriminator test in the merged suite. The merged policy handles both halves in a single baseline-aware pass. If you think anything in yours is still uncovered, say so and I will reopen. |
Summary
Closes #11770.
Screenshots
No visual change
Testing
pnpm lintpnpm typecheckpnpm testpnpm buildFocused validation run in this session:
pnpm exec vitest run --config config/vitest.config.ts src/main/codex/codex-config-mirror.test.ts src/main/codex/config-settings-promotion.test.ts src/main/codex/config-marketplace-refresh-promotion.test.tspnpm typecheck:nodepnpm exec oxlint src/main/codex/config-marketplace-refresh-promotion.ts src/main/codex/config-marketplace-refresh-promotion.test.ts src/main/codex/config-settings-promotion.tspnpm exec oxfmt --check src/main/codex/config-marketplace-refresh-promotion.ts src/main/codex/config-marketplace-refresh-promotion.test.ts src/main/codex/config-settings-promotion.tsgit diff --checkThe base reproduction failed before the fix, and the focused head suite passed with 97 tests and 4 intentional skips. Full lint, test, and build remain CI-gated.
AI Review Report
The final diff is limited to Codex config promotion and its production-composed tests. It compares marketplace source identity and strict timestamp ordering, preserves canonical fields and unrelated settings, and leaves the existing managed-home mirror path in place. No UI, provider, local/remote transport, or new filesystem authority changed.
Security Audit
The change only copies two already-parsed metadata values from a matching managed table into the canonical config. It accepts no new URL, credential, command, or filesystem authority.
Notes
Related config PRs #6577, #9501, and #10221 do not own this marketplace freshness slice.