Repository navigation
fix(models): apply new-model policy before discovery, sync and export publication - #6331
Conversation
… publication Carries #6260 with a maintainer fix: a file-loaded config keeps its file provenance after discovery inventory drift, so stale discovery is refused under the mutation coordinator instead of disabling a model in memory that a later unrelated save would persist over the operator's choice. Co-authored-by: colthreepv <2657230+colthreepv@users.noreply.github.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
✅ Deterministic PR hygiene checks passed. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Repository: lidge-jun/opencodex/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (26)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
|
Maintainer integration into |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 104f29de65
ℹ️ 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".
| if (!baseline.persisted && filePath === undefined) { | ||
| // Standalone/synthetic callers may project their own config, never overwrite another home. | ||
| reconcile(config); |
There was a problem hiding this comment.
Preserve file provenance across startup clones
Treating every unmarked object as synthetic reintroduces the stale-config overwrite in the actual server path: startServer passes the result of loadConfig() through runOpenAiTierStartupMigration, whose projector always structuredClones the config even on a no-op, so the long-lived config loses the new WeakMap provenance. If the file changes before a later discovery begins, baseline.persisted is false and this branch mutates the stale live object instead of refusing it; an operator's persisted enable can therefore become disabled in memory and be written back by an unrelated save. Preserve/transfer provenance through startup transformations, or require explicit synthetic provenance rather than inferring it from filePath === undefined.
Useful? React with 👍 / 👎.
Summary
Carries #6260 by @colthreepv with a maintainer fix. With the new-model policy set to off, discovery, startup/explicit sync and client exports could publish newly arrived models before the policy ran. The policy now applies before each of those publication points, and the localized arrival-policy docs match the English source.
Review found one config-integrity defect in the original:
src/providers/new-model-policy-runtime.tstreated a stale file-backed config as a synthetic one and mutated it in memory. If another writer had recorded a model as known and enabled, stale discovery could disable it in memory, and a later unrelated save would persist that over the operator's choice. A file-loaded config now keeps its file provenance after inventory drift (src/config/rebase-provenance.ts), and stale discovery is refused under the existing mutation coordinator without touching live visibility.Supersedes #6260.
Co-authored-by: colthreepv 2657230+colthreepv@users.noreply.github.com
Verification
dev:bun testover the five new-model-policy suites,config-rebase-provenance-writers, test-layout and file-size ratchet guards: 76 pass / 0 fail;bun x tsc --noEmitpasses. The fix lane also ranconfig-load-degrade(55 pass across its set),privacy:scanandstructure:check.devtip after this landing batch.Checklist