Conversation
Re-importing a custom registry dropped every stale provider through the removal cascade, which clears default_model when it dangles. The batch removal in handleProviderAdd never captured the previous value, and the final setConfig did not even carry defaultModel, so a refresh that still lists the model silently wiped the user's saved default (MoonshotAI#3739). Capture the default before the batch removal and restore it when its alias still resolves after the refresh; a registry that dropped the old model still leaves it cleared, which is the loud failure the next session needs. Regression tests pin both directions against the disk-faithful fake harness.
|
|
You have reached your Codex usage limits for security reviews. Please try again later. |
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. |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 58a05e025d
ℹ️ 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".
| await harness.setConfig({ | ||
| providers: config.providers, | ||
| models: config.models, | ||
| defaultModel: config.defaultModel, |
There was a problem hiding this comment.
Add a CLI changeset for this user-visible fix
This changes user-visible kimi provider add behavior, but the commit contains no .changeset entry, so the fix will neither request the required CLI patch release nor appear in the generated changelog. Add a patch changeset for @moonshot-ai/kimi-code with a short user-facing sentence.
AGENTS.md reference: AGENTS.md:L86-L87
Useful? React with 👍 / 👎.
Fixes #3739.
What
Re-importing a custom registry (
kimi provider add <registry-url>) replaces every stale provider through the removal cascade, which clearsdefault_modelwhen it dangles. The batch removal inhandleProviderAddnever captured the previous value, and the finalsetConfigdid not carrydefaultModeleither, so a refresh that still lists the model silently wiped the user's saved default.How
previousDefaultModelbefore the batch removal.config.models?.[previousDefaultModel]), and passdefaultModelin the finalsetConfig. A registry that genuinely dropped the old model still leaves the default cleared — that is the loud failure the next session needs, and matches the catalog-import path's semantics.Tests
Two regression tests against the disk-faithful fake harness (
removeProviderre-reads from disk,setConfigdeep-merges with undefined keys skipped):kohub/claude-opus-4-7keepsdefault_model(fails without the fix);provider.test.ts40/40 green, check-no-comments and oxlint clean.