import { describe, expect, it, vi } from "vitest"; import type { OpenClawConfig } from "../config/config.js"; import { buildCommandsMessage, buildHelpMessage, buildToolsMessage } from "./status.js";
expect(buildCommandsMessage(cfg)).toContain("/tools - List available runtime tools.");
expect(buildCommandsMessage(cfg)).toContain("More: /tools for available capabilities");
expect(buildHelpMessage(cfg)).toContain("/tools for available capabilities");
expect(buildHelpMessage(cfg)).toContain("/tasks");
});
expect(text).toContain("What this agent can use right now:");
expect(text).toContain("Profile: minimal");
expect(text).toContain("Exec - Run shell commands");
expect(text).toContain("Tool availability depends on this agent's configuration.");
expect(text).not.toContain("unavailable right now");
});
it("trims verbose output before schema-like doc blocks", () => { const text = buildToolsMessage(
{
agentId: "main",
profile: "coding",
groups: [
{
id: "core",
label: "Built-in tools",
source: "core",
tools: [
{
id: "cron",
label: "Cron",
description: "Schedule and manage cron jobs.",
rawDescription: 'Manage Gateway cron jobs and send wake events. Use this for reminders, "check back later" requests, delayed follow-ups, and recurring tasks. Do not emulate scheduling with exec sleep or process polling.\n\nACTIONS:\n- status: Check cron scheduler status\nJOB SCHEMA:\n{ ... }',
source: "core",
},
],
},
],
},
{ verbose: true },
);
expect(text).toContain( 'Cron - Manage Gateway cron jobs and send wake events. Use this for reminders, "check back later" requests, delayed follow-ups, and recurring tasks. Do not emulate scheduling with exec sleep or process polling.',
);
expect(text).not.toContain("ACTIONS:");
expect(text).not.toContain("JOB SCHEMA:");
});
it("returns the empty state when no tools are available", () => {
expect(
buildToolsMessage({
agentId: "main",
profile: "full",
groups: [],
}),
).toBe("No tools are available for this agent right now.\n\nProfile: full");
});
});
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.