fix(coding-agent): stabilize pinned git parsing and model default test

This commit is contained in:
Mario Zechner 2026-02-05 21:43:27 +01:00
parent 5a30e16305
commit 61fe132946
2 changed files with 7 additions and 7 deletions

View file

@ -105,7 +105,7 @@ export function parseGitUrl(source: string): GitSource | null {
const url = source.startsWith("git:") ? source.slice(4).trim() : source;
const split = splitRef(url);
const hostedCandidates = [url, split.ref ? `${split.repo}#${split.ref}` : undefined].filter(
const hostedCandidates = [split.ref ? `${split.repo}#${split.ref}` : undefined, url].filter(
(value): value is string => Boolean(value),
);
for (const candidate of hostedCandidates) {
@ -127,7 +127,7 @@ export function parseGitUrl(source: string): GitSource | null {
}
}
const httpsCandidates = [`https://${url}`, split.ref ? `https://${split.repo}#${split.ref}` : undefined].filter(
const httpsCandidates = [split.ref ? `https://${split.repo}#${split.ref}` : undefined, `https://${url}`].filter(
(value): value is string => Boolean(value),
);
for (const candidate of httpsCandidates) {

View file

@ -202,14 +202,14 @@ describe("parseModelPattern", () => {
});
describe("default model selection", () => {
test("ai-gateway default is opus 4.5", () => {
expect(defaultModelPerProvider["vercel-ai-gateway"]).toBe("anthropic/claude-opus-4.5");
test("ai-gateway default is opus 4.6", () => {
expect(defaultModelPerProvider["vercel-ai-gateway"]).toBe("anthropic/claude-opus-4-6");
});
test("findInitialModel selects ai-gateway default when available", async () => {
const aiGatewayModel: Model<"anthropic-messages"> = {
id: "anthropic/claude-opus-4.5",
name: "Claude Opus 4.5",
id: "anthropic/claude-opus-4-6",
name: "Claude Opus 4.6",
api: "anthropic-messages",
provider: "vercel-ai-gateway",
baseUrl: "https://ai-gateway.vercel.sh",
@ -231,6 +231,6 @@ describe("default model selection", () => {
});
expect(result.model?.provider).toBe("vercel-ai-gateway");
expect(result.model?.id).toBe("anthropic/claude-opus-4.5");
expect(result.model?.id).toBe("anthropic/claude-opus-4-6");
});
});