fix(types): resolve WildcardAliasEntry and test result typings

This commit is contained in:
Antigravity Assistant
2026-04-30 20:42:43 -03:00
parent 983263e45e
commit 3ff2f6a7c9
2 changed files with 9 additions and 6 deletions

View File

@@ -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;

View File

@@ -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 {