fix(ci): repair failing test expectations
This commit is contained in:
@@ -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"));
|
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(
|
function mapThinkingLevelToEffort(
|
||||||
model: Model<"bedrock-converse-stream">,
|
model: Model<"bedrock-converse-stream">,
|
||||||
level: SimpleStreamOptions["reasoning"],
|
level: SimpleStreamOptions["reasoning"],
|
||||||
): "low" | "medium" | "high" | "xhigh" | "max" {
|
): "low" | "medium" | "high" | "xhigh" | "max" {
|
||||||
|
if (level === "xhigh" && supportsNativeXhighEffort(model)) return "xhigh";
|
||||||
|
|
||||||
const mapped = level ? model.thinkingLevelMap?.[level] : undefined;
|
const mapped = level ? model.thinkingLevelMap?.[level] : undefined;
|
||||||
if (typeof mapped === "string") return mapped as "low" | "medium" | "high" | "xhigh" | "max";
|
if (typeof mapped === "string") return mapped as "low" | "medium" | "high" | "xhigh" | "max";
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { PassThrough } from "node:stream";
|
|||||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
import { DefaultPackageManager, type ProgressEvent, type ResolvedResource } from "../src/core/package-manager.js";
|
import { DefaultPackageManager, type ProgressEvent, type ResolvedResource } from "../src/core/package-manager.js";
|
||||||
import { SettingsManager } from "../src/core/settings-manager.js";
|
import { SettingsManager } from "../src/core/settings-manager.js";
|
||||||
|
import { shouldUseWindowsShell } from "../src/utils/child-process.js";
|
||||||
|
|
||||||
function normalizeForMatch(value: string): string {
|
function normalizeForMatch(value: string): string {
|
||||||
return value.replace(/\\/g, "/");
|
return value.replace(/\\/g, "/");
|
||||||
@@ -520,14 +521,11 @@ Content`,
|
|||||||
describe("windows command spawning", () => {
|
describe("windows command spawning", () => {
|
||||||
it("should avoid the shell for git so Windows paths with spaces stay single arguments", () => {
|
it("should avoid the shell for git so Windows paths with spaces stay single arguments", () => {
|
||||||
vi.spyOn(process, "platform", "get").mockReturnValue("win32");
|
vi.spyOn(process, "platform", "get").mockReturnValue("win32");
|
||||||
const managerWithInternals = packageManager as unknown as {
|
|
||||||
shouldUseWindowsShell(command: string): boolean;
|
|
||||||
};
|
|
||||||
|
|
||||||
expect(managerWithInternals.shouldUseWindowsShell("git")).toBe(false);
|
expect(shouldUseWindowsShell("git")).toBe(false);
|
||||||
expect(managerWithInternals.shouldUseWindowsShell("npm")).toBe(true);
|
expect(shouldUseWindowsShell("npm")).toBe(true);
|
||||||
expect(managerWithInternals.shouldUseWindowsShell("pnpm")).toBe(true);
|
expect(shouldUseWindowsShell("pnpm")).toBe(true);
|
||||||
expect(managerWithInternals.shouldUseWindowsShell("C:/Program Files/nodejs/npm.cmd")).toBe(true);
|
expect(shouldUseWindowsShell("C:/Program Files/nodejs/npm.cmd")).toBe(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user