Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: retire the shipped NVIDIA Kimi preset on upgraded installs

Adam Eivyb265c1957082
diff --git a/scripts/migrations/402-retire-nvidia-kimi-provider.js b/scripts/migrations/402-retire-nvidia-kimi-provider.js
index 176e703ded..857fd9a59d 100644
--- a/scripts/migrations/402-retire-nvidia-kimi-provider.js
+++ b/scripts/migrations/402-retire-nvidia-kimi-provider.js
@@ -45,6 +45,10 @@ const comparableProvider = (provider) => {
const comparable = Object.fromEntries(Object.entries(provider).filter(([key]) => !GRAPH_FIELDS.has(key)));
if (!Object.hasOwn(comparable, 'fallbackProvider')) comparable.fallbackProvider = null;
if (!Object.hasOwn(comparable, 'secretEnvVars')) comparable.secretEnvVars = [];
+ // Migration 357 stamps `ultraModel: null` on every provider that lacks one,
+ // and it runs first on every install that still carries this preset. That
+ // null is its no-pin default, not a user edit.
+ if (comparable.ultraModel === null) delete comparable.ultraModel;
return comparable;
};
diff --git a/scripts/migrations/402-retire-nvidia-kimi-provider.test.js b/scripts/migrations/402-retire-nvidia-kimi-provider.test.js
index ec4c6fc168..79d11bebc4 100644
--- a/scripts/migrations/402-retire-nvidia-kimi-provider.test.js
+++ b/scripts/migrations/402-retire-nvidia-kimi-provider.test.js
@@ -63,8 +63,18 @@ describe('migration 402 — retire NVIDIA Kimi provider', () => {
expect(readJson(providersPath).providers).toEqual({});
});
+ // The shape every real upgrade presents: migration 357 runs first and stamps
+ // its `ultraModel: null` default on the preset.
+ it('removes the preset after migration 357 stamped its null ultra tier', async () => {
+ writeJson(providersPath, { providers: { 'nvidia-kimi': { ...shippedProvider(), ultraModel: null } } });
+
+ await expect(migration.up({ rootDir })).resolves.toEqual({ ok: true, reason: 'removed', removed: true });
+ expect(readJson(providersPath).providers).toEqual({});
+ });
+
it('preserves enabled, keyed, renamed, selected, customized, or referenced records', async () => {
const cases = [
+ { ultraModel: 'moonshotai/kimi-k2-thinking' },
{ enabled: true },
{ apiKey: 'nvapi-example' },
{ name: 'My NVIDIA Kimi' },
diff --git a/scripts/migrations/430-retire-nvidia-kimi-after-ultra-tier.js b/scripts/migrations/430-retire-nvidia-kimi-after-ultra-tier.js
new file mode 100644
index 0000000000..6a25156b66
--- /dev/null
+++ b/scripts/migrations/430-retire-nvidia-kimi-after-ultra-tier.js
@@ -0,0 +1,17 @@
+/**
+ * Re-run the NVIDIA Kimi retirement for installs whose ledger already records
+ * migration 402.
+ *
+ * Migration 357 stamps `ultraModel: null` on every provider, and it runs before
+ * 402 on every install that still carried the shipped preset. 402 compared the
+ * record exactly, read that stamp as a user edit, and kept the retired preset
+ * on every upgraded install while recording itself as applied. 402 now treats
+ * the stamp as the default it is; this pass applies the corrected check where
+ * 402 can no longer run. A customized, enabled, keyed or referenced record is
+ * still kept, and an install without the preset is untouched.
+ */
+import retireNvidiaKimi from './402-retire-nvidia-kimi-provider.js';
+
+export default {
+ up: (context) => retireNvidiaKimi.up(context),
+};
diff --git a/scripts/migrations/430-retire-nvidia-kimi-after-ultra-tier.test.js b/scripts/migrations/430-retire-nvidia-kimi-after-ultra-tier.test.js
new file mode 100644
index 0000000000..a7f55f4922
--- /dev/null
+++ b/scripts/migrations/430-retire-nvidia-kimi-after-ultra-tier.test.js
@@ -0,0 +1,58 @@
+import { afterEach, beforeEach, describe, expect, it } from 'vitest';
+import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'fs';
+import { tmpdir } from 'os';
+import { join } from 'path';
+
+import migration from './430-retire-nvidia-kimi-after-ultra-tier.js';
+
+const writeJson = (path, value) => writeFileSync(path, `${JSON.stringify(value, null, 2)}\n`);
+const readJson = (path) => JSON.parse(readFileSync(path, 'utf8'));
+
+// The record an install upgraded through 357 and the original 402 still holds.
+const strandedPreset = () => ({
+ id: 'nvidia-kimi',
+ name: 'NVIDIA Kimi K2.5',
+ type: 'api',
+ endpoint: 'https://integrate.api.nvidia.com/v1',
+ apiKey: '',
+ models: ['moonshotai/kimi-k2.5', 'moonshotai/kimi-k2-instruct', 'moonshotai/kimi-k2-thinking'],
+ defaultModel: 'moonshotai/kimi-k2.5',
+ lightModel: 'moonshotai/kimi-k2-instruct',
+ mediumModel: 'moonshotai/kimi-k2.5',
+ heavyModel: 'moonshotai/kimi-k2-thinking',
+ timeout: 300000,
+ enabled: false,
+ envVars: {},
+ ultraModel: null,
+});
+
+describe('migration 430 — retire NVIDIA Kimi stranded by the ultra-tier stamp', () => {
+ let rootDir;
+ let providersPath;
+
+ beforeEach(() => {
+ rootDir = mkdtempSync(join(tmpdir(), 'migration-430-nvidia-kimi-'));
+ mkdirSync(join(rootDir, 'data'), { recursive: true });
+ providersPath = join(rootDir, 'data/providers.json');
+ });
+
+ afterEach(() => rmSync(rootDir, { recursive: true, force: true }));
+
+ it('removes the preset 402 kept, and leaves user-owned records alone', async () => {
+ writeJson(providersPath, {
+ activeProvider: 'nvidia-nim',
+ providers: { 'nvidia-kimi': strandedPreset(), 'nvidia-nim': { id: 'nvidia-nim', enabled: true } },
+ });
+
+ await expect(migration.up({ rootDir })).resolves.toEqual({ ok: true, reason: 'removed', removed: true });
+ expect(readJson(providersPath)).toEqual({
+ activeProvider: 'nvidia-nim',
+ providers: { 'nvidia-nim': { id: 'nvidia-nim', enabled: true } },
+ });
+
+ const keyed = { ...strandedPreset(), apiKey: 'nvapi-example' };
+ writeJson(providersPath, { providers: { 'nvidia-kimi': keyed } });
+ await expect(migration.up({ rootDir })).resolves.toMatchObject({ reason: 'customized', removed: false });
+ expect(readJson(providersPath).providers['nvidia-kimi']).toEqual(keyed);
+ });
+});