fix(ci): repair failing test expectations

This commit is contained in:
Armin Ronacher
2026-05-03 00:04:27 +02:00
parent cd5bfd04d7
commit b9efafc535
2 changed files with 12 additions and 7 deletions

View File

@@ -494,10 +494,17 @@ function supportsAdaptiveThinking(modelId: string, modelName?: string): boolean
return candidates.some((s) => s.includes("opus-4-6") || s.includes("opus-4-7") || s.includes("sonnet-4-6"));
}
function supportsNativeXhighEffort(model: Model<"bedrock-converse-stream">): boolean {
const candidates = getModelMatchCandidates(model.id, model.name);
return candidates.some((s) => s.includes("opus-4-7"));
}
function mapThinkingLevelToEffort(
model: Model<"bedrock-converse-stream">,
level: SimpleStreamOptions["reasoning"],
): "low" | "medium" | "high" | "xhigh" | "max" {
if (level === "xhigh" && supportsNativeXhighEffort(model)) return "xhigh";
const mapped = level ? model.thinkingLevelMap?.[level] : undefined;
if (typeof mapped === "string") return mapped as "low" | "medium" | "high" | "xhigh" | "max";

View File

@@ -6,6 +6,7 @@ import { PassThrough } from "node:stream";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { DefaultPackageManager, type ProgressEvent, type ResolvedResource } from "../src/core/package-manager.js";
import { SettingsManager } from "../src/core/settings-manager.js";
import { shouldUseWindowsShell } from "../src/utils/child-process.js";
function normalizeForMatch(value: string): string {
return value.replace(/\\/g, "/");
@@ -520,14 +521,11 @@ Content`,
describe("windows command spawning", () => {
it("should avoid the shell for git so Windows paths with spaces stay single arguments", () => {
vi.spyOn(process, "platform", "get").mockReturnValue("win32");
const managerWithInternals = packageManager as unknown as {
shouldUseWindowsShell(command: string): boolean;
};
expect(managerWithInternals.shouldUseWindowsShell("git")).toBe(false);
expect(managerWithInternals.shouldUseWindowsShell("npm")).toBe(true);
expect(managerWithInternals.shouldUseWindowsShell("pnpm")).toBe(true);
expect(managerWithInternals.shouldUseWindowsShell("C:/Program Files/nodejs/npm.cmd")).toBe(true);
expect(shouldUseWindowsShell("git")).toBe(false);
expect(shouldUseWindowsShell("npm")).toBe(true);
expect(shouldUseWindowsShell("pnpm")).toBe(true);
expect(shouldUseWindowsShell("C:/Program Files/nodejs/npm.cmd")).toBe(true);
});
});