mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 05:01:36 +00:00
fix: hide empty status rows
This commit is contained in:
@@ -184,9 +184,7 @@ export async function buildStatusReply(params: {
|
||||
const requesterKey = resolveInternalSessionKey({ key: sessionKey, alias, mainKey });
|
||||
const runs = listSubagentRunsForRequester(requesterKey);
|
||||
const verboseEnabled = resolvedVerboseLevel && resolvedVerboseLevel !== "off";
|
||||
if (runs.length === 0) {
|
||||
if (verboseEnabled) subagentsLine = "🤖 Subagents: none";
|
||||
} else {
|
||||
if (runs.length > 0) {
|
||||
const active = runs.filter((entry) => !entry.endedAt);
|
||||
const done = runs.length - active.length;
|
||||
if (verboseEnabled) {
|
||||
|
||||
@@ -215,6 +215,20 @@ describe("handleCommands subagents", () => {
|
||||
expect(result.reply?.text).toContain("Subagents: none");
|
||||
});
|
||||
|
||||
it("omits subagent status line when none exist", async () => {
|
||||
resetSubagentRegistryForTests();
|
||||
const cfg = {
|
||||
commands: { text: true },
|
||||
channels: { whatsapp: { allowFrom: ["*"] } },
|
||||
session: { mainKey: "main", scope: "per-sender" },
|
||||
} as ClawdbotConfig;
|
||||
const params = buildParams("/status", cfg);
|
||||
params.resolvedVerboseLevel = "on";
|
||||
const result = await handleCommands(params);
|
||||
expect(result.shouldContinue).toBe(false);
|
||||
expect(result.reply?.text).not.toContain("Subagents:");
|
||||
});
|
||||
|
||||
it("returns help for unknown subagents action", async () => {
|
||||
resetSubagentRegistryForTests();
|
||||
const cfg = {
|
||||
|
||||
Reference in New Issue
Block a user