fix: resolve current ci regressions

This commit is contained in:
Peter Steinberger
2026-03-14 00:51:01 +00:00
parent 17eaa59a7a
commit e794417623
10 changed files with 30 additions and 25 deletions

View File

@@ -179,6 +179,7 @@ function makeFallbackSummaryPlugin(params: {
id: "fallback-plugin",
meta: {
id: "fallback-plugin",
label: "Fallback",
selectionLabel: "Fallback",
docsPath: "/channels/fallback",
blurb: "test",
@@ -289,7 +290,7 @@ describe("buildChannelSummary", () => {
]);
});
it("falls back to plugin id and default account id when no label or accounts exist", async () => {
it("uses the channel label and default account id when no accounts exist", async () => {
vi.mocked(listChannelPlugins).mockReturnValue([
makeFallbackSummaryPlugin({
enabled: true,
@@ -304,7 +305,7 @@ describe("buildChannelSummary", () => {
includeAllowFrom: false,
});
expect(lines).toEqual(["fallback-plugin: configured", " - fallback-account"]);
expect(lines).toEqual(["Fallback: configured", " - fallback-account"]);
});
it("shows not-configured status when enabled accounts exist without configured ones", async () => {
@@ -321,6 +322,6 @@ describe("buildChannelSummary", () => {
includeAllowFrom: false,
});
expect(lines).toEqual(["fallback-plugin: not configured"]);
expect(lines).toEqual(["Fallback: not configured"]);
});
});

View File

@@ -4,12 +4,14 @@ import { startHeartbeatRunner } from "./heartbeat-runner.js";
import { requestHeartbeatNow, resetHeartbeatWakeStateForTests } from "./heartbeat-wake.js";
describe("startHeartbeatRunner", () => {
type RunOnce = Parameters<typeof startHeartbeatRunner>[0]["runOnce"];
function useFakeHeartbeatTime() {
vi.useFakeTimers();
vi.setSystemTime(new Date(0));
}
function startDefaultRunner(runOnce: Parameters<typeof startHeartbeatRunner>[0]["runOnce"]) {
function startDefaultRunner(runOnce: RunOnce) {
return startHeartbeatRunner({
cfg: heartbeatConfig(),
runOnce,
@@ -40,7 +42,7 @@ describe("startHeartbeatRunner", () => {
async function expectWakeDispatch(params: {
cfg: OpenClawConfig;
runSpy: ReturnType<typeof vi.fn>;
runSpy: RunOnce;
wake: { reason: string; agentId?: string; sessionKey?: string; coalesceMs: number };
expectedCall: Record<string, unknown>;
}) {

View File

@@ -3,6 +3,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { signalOutbound } from "../../channels/plugins/outbound/signal.js";
import { telegramOutbound } from "../../channels/plugins/outbound/telegram.js";
import { whatsappOutbound } from "../../channels/plugins/outbound/whatsapp.js";
import type { ChannelOutboundAdapter } from "../../channels/plugins/types.adapters.js";
import type { OpenClawConfig } from "../../config/config.js";
import { STATE_DIR } from "../../config/paths.js";
import { setActivePluginRegistry } from "../../plugins/runtime.js";
@@ -83,7 +84,7 @@ type DeliverOutboundArgs = Parameters<typeof deliverOutboundPayloads>[0];
type DeliverOutboundPayload = DeliverOutboundArgs["payloads"][number];
type DeliverSession = DeliverOutboundArgs["session"];
function setMatrixTextOnlyPlugin(sendText: ReturnType<typeof vi.fn>) {
function setMatrixTextOnlyPlugin(sendText: NonNullable<ChannelOutboundAdapter["sendText"]>) {
setActivePluginRegistry(
createTestRegistry([
{