Skip to content

Commit e54fa1a

Browse files
obviyusclaude
andcommitted
feat(status): one fact per line in the plain status body
Chat clients wrap long lines mid-fact, so joining several facts with separators read as a wall. Model, auth, tokens, cost, context, compactions, execution, runtime, activation and queue each take their own line, and the mode switches share one Modes line using the same wording as the rich card. Auth no longer duplicates onto the model line. Co-Authored-By: Claude Fable 5 <[email protected]>
1 parent df8f584 commit e54fa1a

4 files changed

Lines changed: 59 additions & 78 deletions

File tree

‎src/auto-reply/reply/commands-status.test.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ describe("buildStatusReply subagent summary", () => {
872872

873873
const normalized = normalizeTestText(text);
874874
expect(normalized).toContain("Runtime: OpenAI Codex");
875-
expect(normalized).toContain("Fast");
875+
expect(normalized).toContain("fast");
876876
expect(normalized).not.toContain("Fast · codex");
877877
expect(
878878
providerUsageMock.loadProviderUsageSummary.mock.calls.some(([params]) =>
@@ -2207,7 +2207,7 @@ describe("buildStatusReply subagent summary", () => {
22072207
});
22082208

22092209
const normalized = normalizeTestText(text);
2210-
expect(normalized).toContain("Fast");
2210+
expect(normalized).toContain("fast");
22112211
expect(normalized).not.toContain("codex");
22122212
});
22132213

@@ -2241,8 +2241,8 @@ describe("buildStatusReply subagent summary", () => {
22412241
});
22422242

22432243
const normalized = normalizeTestText(text);
2244-
expect(normalized).toContain("Think: max");
2245-
expect(normalized).not.toContain("Think: ultra");
2244+
expect(normalized).toContain("think max");
2245+
expect(normalized).not.toContain("think ultra");
22462246
});
22472247

22482248
it("clamps off to the active provider's always-thinking level", async () => {
@@ -2276,7 +2276,7 @@ describe("buildStatusReply subagent summary", () => {
22762276
activeModelAuthOverride: "api-key",
22772277
});
22782278

2279-
expect(normalizeTestText(text)).toContain("Think: max");
2279+
expect(normalizeTestText(text)).toContain("think max");
22802280
expect(activeProviderThinkingMock.resolveThinkingProfile).toHaveBeenCalledWith(
22812281
expect.objectContaining({
22822282
provider: "moonshot",
@@ -2380,7 +2380,7 @@ describe("buildStatusReply", () => {
23802380

23812381
const reply = await buildKiraStatusReply(cfg);
23822382

2383-
expect(reply?.text).toContain("Think: xhigh");
2383+
expect(reply?.text).toContain("think xhigh");
23842384
});
23852385

23862386
it("shows per-agent fallback overrides in the status card", async () => {

‎src/auto-reply/status.test.ts‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ describe("buildStatusMessage", () => {
145145
expect(normalized).toContain("Execution: direct");
146146
expect(normalized).toContain("Runtime: OpenClaw Default");
147147
expect(normalized).not.toContain("Runner:");
148-
expect(normalized).toContain("Think: medium");
148+
expect(normalized).toContain("think medium");
149149
expect(normalized).not.toContain("verbose");
150150
expect(normalized).toContain("elevated");
151151
expect(normalized).toContain("Queue: collect");
@@ -529,9 +529,9 @@ describe("buildStatusMessage", () => {
529529
});
530530
const normalized = normalizeTestText(text);
531531

532-
expect(normalized).toContain("Think: high");
532+
expect(normalized).toContain("think high");
533533
expect(normalized).toContain("verbose:full");
534-
expect(normalized).toContain("Reasoning: on");
534+
expect(normalized).toContain("reasoning on");
535535
});
536536

537537
it("shows plugin status lines only when verbose is enabled", () => {
@@ -687,7 +687,7 @@ describe("buildStatusMessage", () => {
687687
queue: { mode: "collect", depth: 0 },
688688
});
689689

690-
expect(normalizeTestText(text)).toContain("Fast");
690+
expect(normalizeTestText(text)).toContain("fast");
691691
});
692692

693693
it("shows the Codex harness as the model runtime when resolved", () => {
@@ -706,7 +706,7 @@ describe("buildStatusMessage", () => {
706706
});
707707

708708
const normalized = normalizeTestText(text);
709-
expect(normalized).toContain("Fast");
709+
expect(normalized).toContain("fast");
710710
expect(normalized).toContain("Runtime: OpenAI Codex");
711711
expect(normalized).not.toContain("· codex");
712712
});
@@ -727,7 +727,7 @@ describe("buildStatusMessage", () => {
727727
});
728728

729729
const normalized = normalizeTestText(text);
730-
expect(normalized).toContain("Fast");
730+
expect(normalized).toContain("fast");
731731
expect(normalized).toContain("Runtime: OpenClaw Default");
732732
expect(normalized).not.toContain("· openclaw");
733733
});
@@ -746,7 +746,7 @@ describe("buildStatusMessage", () => {
746746
queue: { mode: "collect", depth: 0 },
747747
});
748748

749-
expect(normalizeTestText(text)).toContain("Fast: off");
749+
expect(normalizeTestText(text)).toContain("fast off");
750750
});
751751

752752
it("shows configured text verbosity for the active model", () => {
@@ -776,7 +776,7 @@ describe("buildStatusMessage", () => {
776776
queue: { mode: "collect", depth: 0 },
777777
});
778778

779-
expect(normalizeTestText(text)).toContain("Text: low");
779+
expect(normalizeTestText(text)).toContain("text low");
780780
});
781781

782782
it("shows per-agent text verbosity overrides for the active model", () => {
@@ -815,7 +815,7 @@ describe("buildStatusMessage", () => {
815815
queue: { mode: "collect", depth: 0 },
816816
});
817817

818-
expect(normalizeTestText(text)).toContain("Text: low");
818+
expect(normalizeTestText(text)).toContain("text low");
819819
});
820820

821821
it("notes channel model overrides in status output", () => {

‎src/status/status-message.ts‎

Lines changed: 42 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,6 @@ export function buildStatusMessageParts(args: StatusArgs): StatusMessageParts {
956956
]
957957
.filter(Boolean)
958958
.join(" • ");
959-
const sessionLine = `Session: ${sessionValue}`;
960959

961960
const isGroupSession =
962961
entry?.chatType === "group" ||
@@ -972,13 +971,6 @@ export function buildStatusMessageParts(args: StatusArgs): StatusMessageParts {
972971
? (formatEstimatedContextBudgetTokens(entry?.contextBudgetStatus, contextTokens) ??
973972
formatTokens(totalTokens, contextTokens ?? null))
974973
: formatTokens(totalTokens, contextTokens ?? null);
975-
const contextLine = [
976-
`Context: ${contextUsageLabel}`,
977-
`🧹 Compactions: ${entry?.compactionCount ?? 0}`,
978-
]
979-
.filter((line): line is string => Boolean(line))
980-
.join(" · ");
981-
982974
const queueMode = args.queue?.mode ?? "unknown";
983975
const queueDetails = formatQueueDetails(args.queue);
984976
const verboseLabel =
@@ -1010,23 +1002,17 @@ export function buildStatusMessageParts(args: StatusArgs): StatusMessageParts {
10101002
fastAutoOnSeconds: fastModeState.fastAutoOnSeconds,
10111003
});
10121004
const optionFlagsValue = [verboseLabel, traceLabel, elevatedLabel].filter(Boolean).join(" · ");
1013-
const optionParts = [
1014-
`Execution: ${execution.label}`,
1015-
`Runtime: ${agentRuntimeLabel}`,
1016-
`Think: ${thinkLevel}`,
1017-
`Fast: ${fastModeValue}`,
1018-
textVerbosity ? `Text: ${textVerbosity}` : null,
1019-
verboseLabel,
1020-
traceLabel,
1021-
reasoningLevel !== "off" ? `Reasoning: ${reasoningLevel}` : null,
1022-
elevatedLabel,
1023-
];
1024-
const optionsLine = optionParts.filter(Boolean).join(" · ");
1025-
const activationParts = [
1026-
groupActivationValue ? `👥 Activation: ${groupActivationValue}` : null,
1027-
`🪢 Queue: ${queueMode}${queueDetails}`,
1028-
];
1029-
const activationLine = activationParts.filter(Boolean).join(" · ");
1005+
// Mode switches are individually tiny; one shared line keeps them scannable
1006+
// in both the plain body and the presentation table.
1007+
const modesValue = [
1008+
`think ${thinkLevel}`,
1009+
`fast ${fastModeValue}`,
1010+
textVerbosity ? `text ${textVerbosity}` : null,
1011+
reasoningLevel !== "off" ? `reasoning ${reasoningLevel}` : null,
1012+
optionFlagsValue || null,
1013+
]
1014+
.filter(Boolean)
1015+
.join(" · ");
10301016

10311017
const selectedModelLabel = modelRefs.selected.label || "unknown";
10321018
const runtimeAliasModelEquivalent = areRuntimeModelRefsEquivalent(
@@ -1087,7 +1073,6 @@ export function buildStatusMessageParts(args: StatusArgs): StatusMessageParts {
10871073
: undefined;
10881074
const costLabel = hasUsage ? formatUsd(cost) : undefined;
10891075

1090-
const selectedAuthLabel = selectedAuthLabelValue ? ` · 🔑 ${selectedAuthLabelValue}` : "";
10911076
const modelNote = channelModelNote ? ` · ${channelModelNote}` : "";
10921077
const configuredDefaultModelLabel = normalizeOptionalString(args.configuredDefaultModelLabel);
10931078
const sessionHasPersistedModelSelection = hasUserPinnedModelSelection(entry);
@@ -1107,8 +1092,9 @@ export function buildStatusMessageParts(args: StatusArgs): StatusMessageParts {
11071092
// A user-driven live switch that no completed turn has applied yet: surface
11081093
// it so /status does not imply the new selection is already running.
11091094
const liveSwitchNote = entry?.liveModelSwitchPending ? " · ⏳ live switch pending" : "";
1095+
// Auth gets its own line below; keeping it inline here duplicated the value.
11101096
const modelLines = [
1111-
`🧠 Model: ${selectedModelLabel}${selectedAuthLabel}${modelNote}${overrideLabel}${liveSwitchNote}`,
1097+
`🧠 Model: ${selectedModelLabel}${modelNote}${overrideLabel}${liveSwitchNote}`,
11121098
];
11131099

11141100
// Show configured fallback models (from agent model config)
@@ -1137,32 +1123,53 @@ export function buildStatusMessageParts(args: StatusArgs): StatusMessageParts {
11371123
const cacheValue = formatCacheHitValue(inputTokens, cacheRead, cacheWrite);
11381124
const cacheLine = cacheValue ? `🗄️ Cache: ${cacheValue}` : null;
11391125
const costLine = costLabel ? `💵 Cost: ${costLabel}` : null;
1140-
const usageCostLine =
1141-
usagePair && costLine ? `${usagePair} · ${costLine}` : (usagePair ?? costLine);
1126+
// Depth 0 is the boring default; the queue row keeps details only when the
1127+
// queue is non-empty or the session carries queue overrides.
1128+
const queueHasSignal = (args.queue?.depth ?? 0) > 0 || args.queue?.showDetails === true;
1129+
const compactionCount = entry?.compactionCount ?? 0;
1130+
const contextPct =
1131+
typeof totalTokens === "number" && totalTokens > 0 && contextTokens > 0
1132+
? Math.min(999, Math.round((totalTokens / contextTokens) * 100))
1133+
: null;
1134+
const contextMeter =
1135+
contextPct !== null
1136+
? (() => {
1137+
const filled = Math.min(10, Math.max(0, Math.round(contextPct / 10)));
1138+
return `${"▰".repeat(filled)}${"▱".repeat(10 - filled)} `;
1139+
})()
1140+
: "";
11421141
const mediaLine = formatMediaUnderstandingLine(args.mediaDecisions);
11431142
const voiceLine = formatVoiceModeLine(args.config, args.sessionEntry, args.agentId);
11441143

1144+
// One fact per line: chat clients wrap long lines mid-fact, so joining
1145+
// several facts with separators reads as a wall rather than a summary.
11451146
const text = [
11461147
versionLine,
11471148
timeLine,
11481149
uptimeLine,
11491150
...modelLines,
1151+
selectedAuthLabelValue ? `🔑 Auth: ${selectedAuthLabelValue}` : null,
11501152
configuredFallbacksLine,
11511153
fallbackLine,
1152-
usageCostLine,
1154+
usagePair,
1155+
costLine,
11531156
cacheLine,
1154-
`📚 ${contextLine}`,
1157+
`📚 Context: ${contextUsageLabel}`,
1158+
compactionCount > 0 ? `🧹 Compactions: ${compactionCount}` : null,
11551159
mediaLine,
11561160
args.usageLine,
1157-
`🧵 ${sessionLine}`,
1161+
`🧵 Session: ${sessionValue}`,
11581162
args.subagentsLine,
11591163
args.taskLine,
11601164
args.channelFeatureLine,
1161-
`⚙️ ${optionsLine}`,
1165+
`⚙️ Execution: ${execution.label}`,
1166+
`🤖 Runtime: ${agentRuntimeLabel}`,
1167+
modesValue ? `🎛️ Modes: ${modesValue}` : null,
11621168
args.pluginHealthLine,
11631169
pluginStatusLine ? `🧩 ${pluginStatusLine}` : null,
11641170
voiceLine,
1165-
activationLine,
1171+
groupActivationValue ? `👥 Activation: ${groupActivationValue}` : null,
1172+
`🪢 Queue: ${queueMode}${queueHasSignal ? queueDetails : ""}`,
11661173
]
11671174
.filter((line): line is string => Boolean(line))
11681175
.join("\n");
@@ -1181,39 +1188,13 @@ export function buildStatusMessageParts(args: StatusArgs): StatusMessageParts {
11811188
pushStatusRow("🧮 Tokens", tokensValue);
11821189
pushStatusRow("💵 Cost", costLabel);
11831190
pushStatusRow("🗄️ Cache", cacheValue);
1184-
const contextPct =
1185-
typeof totalTokens === "number" && totalTokens > 0 && contextTokens > 0
1186-
? Math.min(999, Math.round((totalTokens / contextTokens) * 100))
1187-
: null;
1188-
const contextMeter =
1189-
contextPct !== null
1190-
? (() => {
1191-
const filled = Math.min(10, Math.max(0, Math.round(contextPct / 10)));
1192-
return `${"▰".repeat(filled)}${"▱".repeat(10 - filled)} `;
1193-
})()
1194-
: "";
11951191
pushStatusRow("📚 Context", `${contextMeter}${contextUsageLabel}`);
1196-
const compactionCount = entry?.compactionCount ?? 0;
11971192
pushStatusRow("🧹 Compactions", compactionCount > 0 ? compactionCount : null);
11981193
pushStatusRow("🧵 Session", sessionValue);
11991194
pushStatusRow("⚙️ Execution", execution.label);
12001195
pushStatusRow("Runtime", agentRuntimeLabel);
1201-
pushStatusRow(
1202-
"🎛️ Modes",
1203-
[
1204-
`think ${thinkLevel}`,
1205-
`fast ${fastModeValue}`,
1206-
textVerbosity ? `text ${textVerbosity}` : null,
1207-
reasoningLevel !== "off" ? `reasoning ${reasoningLevel}` : null,
1208-
optionFlagsValue || null,
1209-
]
1210-
.filter(Boolean)
1211-
.join(" · "),
1212-
);
1196+
pushStatusRow("🎛️ Modes", modesValue);
12131197
pushStatusRow("👥 Activation", groupActivationValue);
1214-
// Depth 0 is the boring default; the queue row keeps details only when the
1215-
// queue is non-empty or the session carries queue overrides.
1216-
const queueHasSignal = (args.queue?.depth ?? 0) > 0 || args.queue?.showDetails === true;
12171198
pushStatusRow("🪢 Queue", queueHasSignal ? `${queueMode}${queueDetails}` : queueMode);
12181199

12191200
const contextBlock = (value: string | null | undefined): MessagePresentationBlock[] =>

‎src/status/status-text.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ describe("buildStatusText thinking facts", () => {
349349
includeTranscriptUsage: false,
350350
});
351351

352-
expect(text).toContain("Think: high");
353-
expect(text).not.toMatch(/Think:\s*off\b/);
352+
expect(text).toContain("think high");
353+
expect(text).not.toMatch(/think\s+off\b/);
354354
});
355355
});

0 commit comments

Comments
 (0)