Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

fix(types): resolve WildcardAliasEntry and test result typings

Antigravity Assistant3ff2f6a7c97d
diff --git a/open-sse/services/model.ts b/open-sse/services/model.ts
index ba2708774b..4678be8ca4 100644
--- a/open-sse/services/model.ts
+++ b/open-sse/services/model.ts
@@ -375,7 +375,10 @@ export async function getModelInfoCore(modelStr, aliasesOrGetter) {
// T13: Try wildcard alias (glob patterns like "claude-sonnet-*" → "anthropic/claude-sonnet-4-...")
if (aliases && typeof aliases === "object") {
- const aliasEntries = Object.entries(aliases).map(([pattern, target]) => ({ pattern, target }));
+ const aliasEntries = Object.entries(aliases).map(([pattern, target]) => ({
+ pattern,
+ target: target as string,
+ }));
const wildcardMatch = resolveWildcardAlias(parsed.model, aliasEntries);
if (wildcardMatch) {
const target = wildcardMatch.target as string;
diff --git a/tests/unit/chatgpt-web.test.ts b/tests/unit/chatgpt-web.test.ts
index dd49da1c32..a6976a7fed 100644
--- a/tests/unit/chatgpt-web.test.ts
+++ b/tests/unit/chatgpt-web.test.ts
@@ -71,7 +71,7 @@ function installMockFetch({
onFileDownload,
onAttachmentDownload,
onUserConfig,
-} = {}) {
+}: any = {}) {
const calls = {
session: 0,
dpl: 0,
@@ -2724,8 +2724,8 @@ test("Image edit handler: no cached match returns 400 (does not silently generat
log: null,
});
assert.equal(result.success, false);
- assert.equal(result.status, 400);
- assert.match(String(result.error), /generated through this OmniRoute instance/);
+ assert.equal((result as any).status, 400);
+ assert.match(String((result as any).error), /generated through this OmniRoute instance/);
assert.equal(m.calls.session, 0, "no upstream calls were attempted");
assert.equal(m.calls.conv, 0, "no chat-completion was attempted");
} finally {
@@ -2748,8 +2748,8 @@ test("Image gen handler: n>4 is rejected before any upstream call", async () =>
log: null,
});
assert.equal(result.success, false);
- assert.equal(result.status, 400);
- assert.match(String(result.error), /n=1\.\.4/);
+ assert.equal((result as any).status, 400);
+ assert.match(String((result as any).error), /n=1\.\.4/);
assert.equal(m.calls.session, 0, "no session exchange was attempted");
assert.equal(m.calls.conv, 0, "no conversation request was attempted");
} finally {