Skip to content

Commit 516aaaa

Browse files
authored
chore(providers): deprecate mimo-free (#7445)
* chore(providers): deprecate mimo-free * fix(providers): narrow mimo-free deprecation evidence and cover init discovery State the observed failure (the configured mimo-auto is rejected with 400 "Unsupported model") instead of claiming the vendor ended access for every model, and record the retained-vs-new-discovery contract in the adapter structure docs. The deprecated-entry invariant now also asserts the init menu excludes the entry, closing the one surface CodeRabbit found unverified.
1 parent 30e82f9 commit 516aaaa

10 files changed

Lines changed: 68 additions & 24 deletions

File tree

‎src/cli/provider.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ function handleList(args: string[], active: boolean = localProvidersActive()): v
191191
console.log(` ${name}${isDefault}${source} adapter=${prov.adapter}${model}`);
192192
}
193193

194-
const available = PROVIDER_REGISTRY.filter(e => !configured.includes(e.id));
194+
const available = PROVIDER_REGISTRY.filter(e => !e.deprecated && !configured.includes(e.id));
195195
if (available.length > 0) {
196196
console.log(`\nAvailable from registry (${available.length}):\n`);
197197
for (const entry of available) {
@@ -265,6 +265,7 @@ async function handleAdd(args: string[], deps: ProviderCommandDeps): Promise<voi
265265
const registryEntry = getProviderRegistryEntry(name);
266266

267267
if (registryEntry) {
268+
if (registryEntry.deprecated) console.warn(`Warning: provider "${name}" is deprecated: ${registryEntry.deprecated}`);
268269
provConfig = providerConfigSeed(registryEntry);
269270
if (apiKey) {
270271
const candidateError = providerCredentialInputError({ apiKey });

‎src/providers/derive.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,9 @@ export function deriveKeyLoginMap(): Record<string, DerivedKeyLoginProvider> {
312312
const out: Record<string, DerivedKeyLoginProvider> = {};
313313
for (const entry of PROVIDER_REGISTRY) {
314314
if (entry.authKind !== "key") continue;
315+
// A deprecated route cannot complete a login, but its entry must stay resolvable for
316+
// configs saved while it still worked.
317+
if (entry.deprecated) continue;
315318
if (!entry.dashboardUrl) throw new Error(`Registry key provider missing dashboardUrl: ${entry.id}`);
316319
const liveModels = registryEntrySupportsLiveModelDiscovery(entry) ? entry.liveModels : false;
317320
out[entry.id] = {
@@ -364,7 +367,7 @@ export function deriveKeyLoginMap(): Record<string, DerivedKeyLoginProvider> {
364367
}
365368

366369
export function deriveInitProviders(): DerivedInitProvider[] {
367-
return PROVIDER_REGISTRY.map(entry => ({
370+
return PROVIDER_REGISTRY.filter(entry => !entry.deprecated).map(entry => ({
368371
id: entry.id,
369372
label: formatInitLabel(entry),
370373
adapter: entry.adapter,
@@ -391,6 +394,7 @@ export function deriveOAuthIds(): string[] {
391394

392395
export function deriveProviderPresets(): DerivedProviderPreset[] {
393396
const presets = PROVIDER_REGISTRY
397+
.filter(entry => !entry.deprecated)
394398
.filter(entry => entry.featured || entry.authKind === "key" || entry.dashboardPreset)
395399
.map(entryToPreset);
396400
return [...dedupePresets(presets), customPreset()];
@@ -633,7 +637,7 @@ export function enrichProviderFromRegistry(name: string, prov: OcxProviderConfig
633637
}
634638

635639
export function deriveFeaturedProviderIds(): string[] {
636-
return PROVIDER_REGISTRY.filter(entry => entry.featured).map(entry => entry.id);
640+
return PROVIDER_REGISTRY.filter(entry => entry.featured && !entry.deprecated).map(entry => entry.id);
637641
}
638642

639643
export function deriveJawcodeAliases(): Record<string, string> {

‎src/providers/registry/entries-extended.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,14 +1303,15 @@ export const PROVIDER_REGISTRY_EXTENDED: readonly ProviderRegistryEntry[] = [
13031303
baseUrl: "https://api.xiaomimimo.com/api/free-ai/openai/chat",
13041304
authKind: "key",
13051305
keyOptional: true,
1306-
featured: true,
1306+
featured: false,
1307+
deprecated: "Deprecated: requests through this entry fail. Bootstrap may still return a JWT, but /api/free-ai/openai/chat rejects the configured model \"mimo-auto\" with 400 \"Unsupported model\". Kept only so existing saved providers keep resolving; new setups should use the keyed xiaomi provider.",
13071308
liveModels: true,
13081309
dashboardUrl: "https://xiaomimimo.com",
13091310
defaultModel: "mimo-auto",
13101311
models: ["mimo-auto"],
13111312
reasoningEfforts: ["low", "medium", "high"],
13121313
reasoningEffortMap: { xhigh: "high", max: "high", ultra: "high" },
1313-
note: "No key needed — uses Xiaomi MiMo's free public tier (limited-time offer). A JWT is bootstrapped automatically with an anonymous random client id stored locally. The endpoint contract mirrors the official MiMoCode client and is not publicly documented — Xiaomi may change or restrict it at any time. Prompts may be processed/retained by Xiaomi; do not send confidential material.",
1314+
note: "Deprecated: the anonymous MiMo free lane stopped completing requests for this entry in 2026. Bootstrap may still issue a JWT, but /api/free-ai/openai/chat rejects the configured model \"mimo-auto\" with 400 \"Unsupported model\", so turns cannot finish. This entry remains only so existing saved providers keep resolving; add the keyed Xiaomi provider at https://platform.xiaomimimo.com instead. Xiaomi may resume or change the service at any time.",
13141315
},
13151316
// Xiaomi MiMo paid token plan. Separate host and wire from both `xiaomi` (Anthropic) and
13161317
// `mimo-free` (free tier, bespoke adapter), so it needs its own entry rather than a variant.

‎src/providers/registry/model-ids.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export const REGISTRY_FIELD_MODEL_ID_ROLES = {
6161
featured: NONE,
6262
sponsor: NONE,
6363
dashboardPreset: NONE,
64+
deprecated: NONE,
6465
note: NONE,
6566
dashboardUrl: NONE,
6667
defaultModel: NONE,

‎src/providers/registry/types.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,14 @@ export interface ProviderRegistryEntry {
160160
*/
161161
sponsor?: { tier: "main" | "standard"; url: string };
162162
dashboardPreset?: boolean;
163+
/**
164+
* The upstream route or service this entry depends on is gone. Deprecated entries stay in the
165+
* registry so saved providers keep resolving and a pinned adapter keeps loading, but they are
166+
* excluded from the add-provider picker, the init menu, the featured list, and new key logins.
167+
* The value is the operator-facing reason; it is registry-only and never seeded into saved
168+
* config.
169+
*/
170+
deprecated?: string;
163171
note?: string;
164172
dashboardUrl?: string;
165173
defaultModel?: string;

‎structure/adapters/registry.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ Some adapters share another adapter's routed-tool semantics while retaining inde
2929
- `azure` and `azure-openai` inherit the `openai-responses` contract.
3030
The inherited contract includes Meta Muse's host-gated 64-character tool-name alias when the
3131
constructed send URL is `api.meta.ai` (`src/responses/muse-tool-name-alias.ts`).
32-
- `mimo-free` inherits the `openai-chat` contract.
32+
- `mimo-free` inherits the `openai-chat` contract. Its registry entry is `deprecated`: saved
33+
providers keep resolving to this adapter with their stored configuration, while new-provider
34+
discovery (presets, the init menu, the featured list, and key logins) excludes it and
35+
`provider add` warns before creating one.
3336
- `claude-cli` inherits the `codebuddy` contract. Claude Code speaks the same stream-json
3437
protocol this repository already parses for CodeBuddy and Qoder, so the wire is inherited and the
3538
family module (`src/adapters/claude-cli/`) supplies only its own arguments and child environment.

‎structure/providers-and-adapters.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ rewrite rules and the routed-id settlement.
210210
| `src/adapters/zed.ts`, `src/providers/zed.ts`, `src/oauth/zed.ts` | Zed Hosted AI native-app RSA login, account-scoped short-lived LLM-token exchange, bounded live model discovery, and provider-envelope translation through the existing Anthropic, Google, Responses, and Chat builders. Buffered delivery retains events under the shared translator budget and cancels delegated streams on early exit. The Responses delegate applies destination compatibility, strips OpenAI-private fields and unsupported built-in tools, reconciles removed tool choices through the shared hosted-tool policy, and maps OpenAI `developer` messages to Zed-supported `system` messages before wrapping the request. Experimental and unofficial; the Zed terms risk is intentionally surfaced in user docs and release review. |
211211
| `src/adapters/devin.ts`, `src/adapters/devin/cloud-direct/` | Devin runTurn transport over Cognition Connect-RPC. Assistant reasoning replays as ChatMessagePrompt #11 thinking, #12 signature and #18 signature type (`src/adapters/devin/reasoning-signature.ts`): the #10/#21 pair arrives after the visible answer and becomes its own signature-only reasoning item, so a single unsigned thinking block plus exactly one signature-only block is replayed as one signed prompt, and a signature-only turn (GPT, Gemini) is replayed rather than dropped. An Anthropic signature is replayed, but because the streamed thinking is a summary the signature may not cover, a turn Cognition refuses with `invalid_argument` before any visible output (reasoning alone does not count) is retried once with Anthropic signatures withheld and the thinking text kept. `GetChatMessage` uses the Responses provider executor and shared physical-send budget; catalog, JWT, and `src/web-search/devin-executor.ts` native search support RPCs remain outside inference-send accounting. Provider-stated pre-output 429 reset delays are surfaced immediately by default, releasing shared active-turn capacity. A positive `OPENCODEX_DEVIN_STATED_RESET_WAIT_MS` explicitly enables bounded waiting and up to two replays on standalone turns, which hold that capacity until completion or cancellation. Combo children bypass that wait and surface a pre-output 429 so the next target can run. During an opted-in standalone wait, safe heartbeats commit the response preflight and keep the stream's stall watchdog fed. Invalid values fail closed to the immediate-refusal behavior. A recorded tenant host is used only for the stored account whose credential owns the transmitted key, searched in the configured provider id and then its deprecated alias; a configured, forwarded, or unmatched key uses the configured base URL or the US default. Native search previews the current route by effective adapter without mutating combo selection state, pins one admitted active-account snapshot for the request, and calls `GetWebSearchResults`, so it starts no CLI or second model. The wire model UID comes from the catalog's family metadata (`ClientModelConfig` #23/#30/#31): a family id with no effort anchors on the family's default member and selects the nearest enabled rung, rounding up first; an effort moves only the effort axis, to the lowest rung at or above it (else the highest below) while Fast Mode, 1M Context and the other axes stay at the anchor's values unless the caller asked for `fast` or a `1m` value; not lowering a requested effort outranks keeping those axes (an unranked member counts as lower), a disabled row the caller named is kept when the request still selects it so the preflight names that refusal, and resolution never leaves the family. Rows without family metadata fall back to suffix resolution, whose variant scan matches the collapsed base rather than a string prefix. With no caller or configured output cap, the selected row's catalog `maxOutputTokens` fills CompletionConfiguration #2; #3 is `max_newlines` and is sent at a fixed value, never a context window. The leading system text is sent as `GetChatMessage` #2, a failed tool result sets ChatMessagePrompt #9 and keeps an in-band `ERROR:` marker, and Gemini uids have JSON-Schema type arrays expressed as type-only `anyOf` branches in tool parameters. Shared constraints remain on the surrounding node, so nested schemas have one wire representation while outer enum/const, boolean constraints (including `not`, `oneOf`, and `allOf`) on null, and existing null-branch restrictions retain their conjunctive meaning. A null-only type keeps its null constraint even when an outer enum/const excludes null, preserving an unsatisfiable schema without producing an empty anyOf. Schema resource identifiers, anchors, definition maps, and existing anyOf branches remain on their original node. The type constraint is appended to existing allOf entries without shifting their indices, so JSON Pointer targets and reference scopes remain unchanged. A pre-output `invalid_argument` on a history whose word-piece estimate, using the sanitized and truncated tool descriptions actually sent on the wire, reaches 95% of the selected UID's catalog input window, capped by configured provider and model limits (512 KiB of text only when no window is known) is surfaced as `context_length_exceeded` so Codex compacts; a small request with the same code stays a plain 400. Known limit: a malformed schema on a history already at or above that 95% threshold is also reported as overflow because the upstream returns the same `invalid_argument`. The `COGNITION_BLOCKLIST_REWRITES` sanitizer rewrites exact phrases Cognition refuses with `permission_denied`; it runs only on instruction surfaces — tool descriptions and the #2 system prompt — while message text, replayed thinking (#11), and tool-call arguments stay byte-exact, because a rewrite there would silently change literal content such as patches or quoted file bytes; a trigger inside a data field surfaces as the upstream `permission_denied` instead (the Codex `<permissions instructions>` escalation boilerplate is the recorded #2 case). |
212212
| `src/adapters/kiro.ts` and `src/adapters/kiro/` | Kiro event/tool/thinking/truncation/retry handling, including an egress-aware completion fallback, fixed public HTTP 5xx text, and closed-set status/code diagnostics. The original path is a facade over leaves for wire identity, reasoning, conversation state, token estimation, payload assembly, streaming, and the adapter. |
213-
| `src/adapters/mimo-free.ts` | Mimo Free transport (client identity + JWT). Concurrent requests share one JWT bootstrap bound only to its timeout; each request stops waiting on its own abort without cancelling the others. |
213+
| `src/adapters/mimo-free.ts` | Mimo Free transport (client identity + JWT). Concurrent requests share one JWT bootstrap bound only to its timeout; each request stops waiting on its own abort without cancelling the others. Its registry entry is `deprecated`: existing saved providers keep the adapter and their stored configuration, while new-provider discovery (presets, the init menu, the featured list, and key logins) excludes it and `provider add` warns before creating one. |
214214
| `src/adapters/command-code.ts`, `src/adapters/command-code-tool-text.ts`, `src/adapters/command-code-restored-schema.ts` | Command Code OAuth NDJSON translation. For every `xiaomi/mimo-` model, text, native calls, reasoning, and terminal decisions share one byte-bounded queue with linear queue visits. Markup is deduplicated against matching native calls; text-only restoration requires one contiguous bare text block, a clean finish, a declared tool, and arguments validated against supported schema constraints. A parameter-free (freeform) block may omit `</function>` but must end with `</tool_call>`; parameter blocks keep the canonical close. Markup appended after prose, including a marker in a later delta of the same text block, is held as a tail that can never mint a call: possible trailing marker prefixes stay in the same byte-accounted probe across deltas and release as text on a mismatch, boundary or end; a same-content native call strips a completed envelope as an echo, and anything else releases as presentation text so quoted examples stay inert. A tail waits only while a native input it could echo is open, counting the first later input of its own tool, so it is released as soon as those close without a match. Native, reasoning, and other intervening events interrupt a still-probing block but leave a held block held in arrival order, and the queued byte bound still flushes an unresolved envelope as text. An envelope the strict parser rejects but that opens with `<tool_call>`, closes with `</tool_call>`, and names a declared function is dropped when a native call for that same function arrives and on a clean finish; markup that parses but fits no supported schema is still released as text. Regex patterns, other unsupported constraints, and abnormal finishes fail closed. `tests/providers/command-code-tool-text-prose-split.test.ts` covers the prose boundary, the interleaved-event hold, and both drop paths. |
215215
| `src/adapters/image.ts`, `src/adapters/anthropic-image-guard.ts`, `src/adapters/anthropic-image-normalize.ts`, `src/adapters/anthropic-image-codec.ts` | Image conversion for adapter ingress and Anthropic-specific normalization/limits. An image's ladder position is pinned to its own identity (content hash + media type), so appending a newer image cannot re-encode older ones and bust Anthropic's prompt prefix cache (#4532). |
216216
| `src/adapters/run-turn-queue.ts`, `src/adapters/tool-catalog-nudge.ts`, `src/adapters/identity.ts`, `src/adapters/upstream-http-error.ts` | Shared adapter execution support: turn queueing, tool-catalog nudging, client identity, upstream error normalization. |

‎tests/cli/cli-provider.test.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,17 @@ describe("ocx provider mutating --json", () => {
676676
}
677677
});
678678

679+
test("provider add warns when the registry entry is deprecated", () => {
680+
const { dir } = freshConfig();
681+
try {
682+
const result = runCli(["provider", "add", "mimo-free"], { OPENCODEX_HOME: dir });
683+
expect(result.status).toBe(0);
684+
expect(result.stderr).toContain('provider "mimo-free" is deprecated');
685+
} finally {
686+
removeTreeWithRetry(dir);
687+
}
688+
});
689+
679690
test("provider remove --json returns structured output", () => {
680691
const { dir } = freshConfig({
681692
providers: {

‎tests/providers/mimo-free-provider.test.ts‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, expect, test, mock, beforeEach } from "bun:test";
22
import { PROVIDER_REGISTRY } from "../../src/providers/registry";
3-
import { providerConfigSeed, deriveKeyLoginMap, deriveFeaturedProviderIds } from "../../src/providers/derive";
3+
import { providerConfigSeed, deriveKeyLoginMap, deriveFeaturedProviderIds, deriveProviderPresets } from "../../src/providers/derive";
44
import {
55
getMimoClientId,
66
resetMimoClientIdCache,
@@ -91,28 +91,32 @@ describe("mimo-free provider registry", () => {
9191
expect(entry?.baseUrl).toBe("https://api.xiaomimimo.com/api/free-ai/openai/chat");
9292
expect(entry?.authKind).toBe("key");
9393
expect(entry?.keyOptional).toBe(true);
94-
expect(entry?.featured).toBe(true);
94+
expect(entry?.featured).toBe(false);
95+
expect(entry?.deprecated).toBeTruthy();
9596
expect(entry?.liveModels).toBe(true);
9697
expect(entry?.defaultModel).toBe("mimo-auto");
9798
});
9899

99-
test("providerConfigSeed preserves keyOptional and disables static live discovery", () => {
100+
test("providerConfigSeed still resolves a saved provider and disables static live discovery", () => {
100101
const seed = providerConfigSeed(entry!);
102+
expect(seed.adapter).toBe("mimo-free");
101103
expect(seed.keyOptional).toBe(true);
102104
expect(seed.liveModels).toBe(false);
103105
});
104106

105-
test("is included in the key-login map", () => {
107+
test("is excluded from the key-login map", () => {
106108
const keyMap = deriveKeyLoginMap();
107-
expect(keyMap["mimo-free"]).toBeDefined();
109+
expect(keyMap["mimo-free"]).toBeUndefined();
108110
});
109111

110-
test("is in the featured provider list", () => {
111-
expect(deriveFeaturedProviderIds()).toContain("mimo-free");
112+
test("is excluded from the featured list and the add-provider presets", () => {
113+
expect(deriveFeaturedProviderIds()).not.toContain("mimo-free");
114+
expect(deriveProviderPresets().find(preset => preset.id === "mimo-free")).toBeUndefined();
112115
});
113116

114-
test("provider note mentions no key needed", () => {
115-
expect(entry?.note?.toLowerCase()).toContain("no key needed");
117+
test("provider note explains the deprecation and the upstream failure", () => {
118+
expect(entry?.note?.toLowerCase()).toContain("deprecated");
119+
expect(entry?.note?.toLowerCase()).toContain("unsupported model");
116120
});
117121
});
118122

@@ -555,12 +559,8 @@ describe("mimo-free request cancellation", () => {
555559
});
556560

557561
describe("mimo-free GUI preset", () => {
558-
test("deriveProviderPresets exposes keyOptional for picker", () => {
559-
const { deriveProviderPresets } = require("../../src/providers/derive");
562+
test("deprecated provider is hidden from the picker", () => {
560563
const presets = deriveProviderPresets();
561-
const preset = presets.find((p: { id: string }) => p.id === "mimo-free");
562-
expect(preset).toBeDefined();
563-
expect(preset.keyOptional).toBe(true);
564-
expect(preset.note).toMatch(/no key needed/i);
564+
expect(presets.find((p: { id: string }) => p.id === "mimo-free")).toBeUndefined();
565565
});
566566
});

0 commit comments

Comments
 (0)