fix(providers): switched xiaomi validation to mimo-v2.5
- Updated Xiaomi MiMo standard validation and catalog defaults to use the supported mimo-v2.5 model. - Added regression coverage for standard sk- validation and the Xiaomi default model descriptor. Fixes #4063
This commit is contained in:
@@ -2,6 +2,10 @@
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed Xiaomi MiMo standard API-key validation to use the supported `mimo-v2.5` model. ([#4063](https://github.com/can1357/oh-my-pi/issues/4063))
|
||||
|
||||
## [16.2.12] - 2026-07-01
|
||||
|
||||
### Changed
|
||||
|
||||
@@ -18,7 +18,7 @@ const STANDARD_AUTH_URL = "https://platform.xiaomimimo.com/#/console/api-keys";
|
||||
const TOKEN_PLAN_AUTH_URL = "https://platform.xiaomimimo.com/console/plan-manage";
|
||||
const STANDARD_API_BASE_URL = "https://api.xiaomimimo.com/v1";
|
||||
const TOKEN_PLAN_KEY_PREFIX = "tp-";
|
||||
const STANDARD_VALIDATION_MODEL = "mimo-v2-flash";
|
||||
const STANDARD_VALIDATION_MODEL = "mimo-v2.5";
|
||||
const TOKEN_PLAN_VALIDATION_MODEL = "mimo-v2.5";
|
||||
const TOKEN_PLAN_SGP_API_BASE_URL = "https://token-plan-sgp.xiaomimimo.com/v1";
|
||||
const TOKEN_PLAN_AMS_API_BASE_URL = "https://token-plan-ams.xiaomimimo.com/v1";
|
||||
|
||||
@@ -55,9 +55,11 @@ describe("xiaomi oauth validation", () => {
|
||||
it("sends Authorization: Bearer for standard sk- keys as well", async () => {
|
||||
const capturedHeaders: Record<string, string>[] = [];
|
||||
const capturedUrls: string[] = [];
|
||||
const capturedBodies: string[] = [];
|
||||
const fetchMock: FetchImpl = vi.fn(async (input, init) => {
|
||||
capturedUrls.push(typeof input === "string" ? input : input.toString());
|
||||
capturedHeaders.push((init?.headers ?? {}) as Record<string, string>);
|
||||
capturedBodies.push(String(init?.body));
|
||||
return new Response("{}", { status: 200, headers: { "Content-Type": "application/json" } });
|
||||
});
|
||||
|
||||
@@ -69,6 +71,7 @@ describe("xiaomi oauth validation", () => {
|
||||
|
||||
expect(fetchMock).toHaveBeenCalledTimes(1);
|
||||
expect(capturedUrls[0]).toBe("https://api.xiaomimimo.com/v1/chat/completions");
|
||||
expect(JSON.parse(capturedBodies[0]).model).toBe("mimo-v2.5");
|
||||
const headers = capturedHeaders[0];
|
||||
expect(headers.Authorization).toBe("Bearer sk-test-key");
|
||||
expect(headers["x-api-key"]).toBeUndefined();
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed the Xiaomi provider default model to use the supported `mimo-v2.5` model. ([#4063](https://github.com/can1357/oh-my-pi/issues/4063))
|
||||
|
||||
## [16.2.12] - 2026-07-01
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
@@ -415,7 +415,7 @@ export const CATALOG_PROVIDERS = [
|
||||
},
|
||||
{
|
||||
id: "xiaomi",
|
||||
defaultModel: "mimo-v2-flash",
|
||||
defaultModel: "mimo-v2.5",
|
||||
envVars: ["XIAOMI_API_KEY"],
|
||||
createModelManagerOptions: (config: ModelManagerConfig) => xiaomiModelManagerOptions(config),
|
||||
catalogDiscovery: { label: "Xiaomi" },
|
||||
|
||||
@@ -16,6 +16,7 @@ describe("catalog provider descriptors", () => {
|
||||
expect(DEFAULT_MODEL_PER_PROVIDER.minimax).toBe("MiniMax-M3");
|
||||
expect(DEFAULT_MODEL_PER_PROVIDER["minimax-code"]).toBe("MiniMax-M3");
|
||||
expect(DEFAULT_MODEL_PER_PROVIDER["minimax-code-cn"]).toBe("MiniMax-M3");
|
||||
expect(DEFAULT_MODEL_PER_PROVIDER.xiaomi).toBe("mimo-v2.5");
|
||||
// Login-only tools have no default model.
|
||||
expect(DEFAULT_MODEL_PER_PROVIDER).not.toHaveProperty("kagi");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user