From e1433cf65b0a7a0d769bf6017b554a300c41fe1a Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 3 May 2026 00:04:27 +0200 Subject: [PATCH] fix(ci): repair failing test expectations --- packages/ai/src/providers/amazon-bedrock.ts | 7 +++++++ packages/coding-agent/test/package-manager.test.ts | 12 +++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/packages/ai/src/providers/amazon-bedrock.ts b/packages/ai/src/providers/amazon-bedrock.ts index e4200e9d..1812d3c8 100644 --- a/packages/ai/src/providers/amazon-bedrock.ts +++ b/packages/ai/src/providers/amazon-bedrock.ts @@ -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"; diff --git a/packages/coding-agent/test/package-manager.test.ts b/packages/coding-agent/test/package-manager.test.ts index 629e8b84..ca0ffd75 100644 --- a/packages/coding-agent/test/package-manager.test.ts +++ b/packages/coding-agent/test/package-manager.test.ts @@ -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); }); });