diff --git a/src/agents/pi-embedded-runner/run/attempt.spawn-workspace.test-support.ts b/src/agents/pi-embedded-runner/run/attempt.spawn-workspace.test-support.ts index 6b5175ea2b1..947bc05509d 100644 --- a/src/agents/pi-embedded-runner/run/attempt.spawn-workspace.test-support.ts +++ b/src/agents/pi-embedded-runner/run/attempt.spawn-workspace.test-support.ts @@ -13,6 +13,7 @@ import type { IngestResult, } from "../../../context-engine/types.js"; import { formatErrorMessage } from "../../../infra/errors.js"; +import { normalizeLowercaseStringOrEmpty } from "../../../shared/string-coerce.js"; import type { EmbeddedContextFile } from "../../pi-embedded-helpers.js"; import type { MessagingToolSend } from "../../pi-embedded-messaging.js"; import type { WorkspaceBootstrapFile } from "../../workspace.js"; @@ -391,7 +392,7 @@ vi.mock("../../../image-generation/runtime.js", () => ({ })); vi.mock("../../model-selection.js", () => ({ - normalizeProviderId: (providerId?: string) => providerId?.trim().toLowerCase() ?? "", + normalizeProviderId: (providerId?: string) => normalizeLowercaseStringOrEmpty(providerId), resolveDefaultModelForAgent: () => ({ provider: "openai", model: "gpt-test" }), })); diff --git a/src/agents/test-helpers/fast-openclaw-tools-sessions.ts b/src/agents/test-helpers/fast-openclaw-tools-sessions.ts index 4d27b8fcb17..039b29bb524 100644 --- a/src/agents/test-helpers/fast-openclaw-tools-sessions.ts +++ b/src/agents/test-helpers/fast-openclaw-tools-sessions.ts @@ -1,4 +1,5 @@ import { vi } from "vitest"; +import { normalizeOptionalLowercaseString } from "../../shared/string-coerce.js"; import { stubTool } from "./fast-tool-stubs.js"; // Sessions-tool tests only exercise sessions/subagent registrations. @@ -45,7 +46,7 @@ vi.mock("../tools/update-plan-tool.js", () => ({ vi.mock("../../channels/plugins/index.js", () => ({ getChannelPlugin: () => null, - normalizeChannelId: (channel?: string) => channel?.trim().toLowerCase() || undefined, + normalizeChannelId: (channel?: string) => normalizeOptionalLowercaseString(channel), listChannelPlugins: () => [], })); diff --git a/src/auto-reply/reply.directive.directive-behavior.e2e-harness.ts b/src/auto-reply/reply.directive.directive-behavior.e2e-harness.ts index e3371c92d40..a1fc1161e54 100644 --- a/src/auto-reply/reply.directive.directive-behavior.e2e-harness.ts +++ b/src/auto-reply/reply.directive.directive-behavior.e2e-harness.ts @@ -9,6 +9,7 @@ import { createEmptyPluginRegistry } from "../plugins/registry-empty.js"; import type { PluginProviderRegistration } from "../plugins/registry.js"; import { resetPluginRuntimeStateForTest, setActivePluginRegistry } from "../plugins/runtime.js"; import type { ProviderPlugin } from "../plugins/types.js"; +import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js"; import { loadModelCatalogMock, runEmbeddedPiAgentMock, @@ -61,7 +62,8 @@ function createThinkingPolicyProvider( id: providerId, label: providerId, auth: [], - supportsXHighThinking: ({ modelId }) => xhighModelIds.includes(modelId.trim().toLowerCase()), + supportsXHighThinking: ({ modelId }) => + xhighModelIds.includes(normalizeLowercaseStringOrEmpty(modelId)), }; } diff --git a/src/canvas-host/a2ui/index.html b/src/canvas-host/a2ui/index.html index 57e767860d4..7e19e30a716 100644 --- a/src/canvas-host/a2ui/index.html +++ b/src/canvas-host/a2ui/index.html @@ -6,9 +6,13 @@