From 0b82a7e718e3f8fc228d020d05ef0ff84e1dd6ff Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Tue, 28 Apr 2026 00:27:02 -0700 Subject: [PATCH] test(ci): align main test expectations --- .../commands-status.thinking-default.test.ts | 30 +++++++++++++++++-- .../channels.list.auth-profiles.test.ts | 3 +- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/auto-reply/reply/commands-status.thinking-default.test.ts b/src/auto-reply/reply/commands-status.thinking-default.test.ts index 841d5bd4480..2896d374f1c 100644 --- a/src/auto-reply/reply/commands-status.thinking-default.test.ts +++ b/src/auto-reply/reply/commands-status.thinking-default.test.ts @@ -113,7 +113,33 @@ describe("buildStatusReply", () => { expect(reply?.text).not.toContain("Fallbacks: anthropic/claude-sonnet-4-6"); }); - it("keeps default fallback config when the agent has no explicit fallback override", async () => { + it("keeps default fallback config when the agent has no explicit model", async () => { + const cfg = { + session: { mainKey: "main", scope: "per-sender" }, + agents: { + defaults: { + model: { + primary: "openai/gpt-5.4", + fallbacks: ["anthropic/claude-sonnet-4-6"], + }, + }, + list: [ + { + id: "kira", + }, + ], + }, + channels: { + whatsapp: { allowFrom: ["*"] }, + }, + } as OpenClawConfig; + + const reply = await buildKiraStatusReply(cfg); + + expect(reply?.text).toContain("Fallbacks: anthropic/claude-sonnet-4-6"); + }); + + it("keeps agent primary strict when the agent has no explicit fallback override", async () => { const cfg = { session: { mainKey: "main", scope: "per-sender" }, agents: { @@ -139,7 +165,7 @@ describe("buildStatusReply", () => { const reply = await buildKiraStatusReply(cfg); - expect(reply?.text).toContain("Fallbacks: anthropic/claude-sonnet-4-6"); + expect(reply?.text).not.toContain("Fallbacks:"); }); it("treats an explicit empty per-agent fallback override as disabling inherited fallbacks", async () => { diff --git a/src/commands/channels.list.auth-profiles.test.ts b/src/commands/channels.list.auth-profiles.test.ts index de51794994d..e813b349ffc 100644 --- a/src/commands/channels.list.auth-profiles.test.ts +++ b/src/commands/channels.list.auth-profiles.test.ts @@ -1,5 +1,6 @@ import { beforeEach, describe, expect, it, vi } from "vitest"; import type { ChannelPlugin } from "../channels/plugins/types.plugin.js"; +import { stripAnsi } from "../terminal/ansi.js"; import { baseConfigSnapshot, createTestRuntime } from "./test-runtime-config-helpers.js"; const mocks = vi.hoisted(() => ({ @@ -176,7 +177,7 @@ describe("channels list auth profiles", () => { expect.any(Object), expect.objectContaining({ includeSetupRuntimeFallback: true }), ); - const output = runtime.log.mock.calls[0]?.[0] as string; + const output = stripAnsi(runtime.log.mock.calls[0]?.[0] as string); expect(output).toContain("Chat channels:"); expect(output).toContain("Telegram default:"); expect(output).toContain("configured");