fix: combine status usage and cost line
This commit is contained in:
@@ -93,8 +93,7 @@ describe("buildStatusMessage", () => {
|
|||||||
|
|
||||||
expect(text).toContain("🦞 ClawdBot");
|
expect(text).toContain("🦞 ClawdBot");
|
||||||
expect(text).toContain("🧠 Model: anthropic/pi:opus · 🔑 api-key");
|
expect(text).toContain("🧠 Model: anthropic/pi:opus · 🔑 api-key");
|
||||||
expect(text).toContain("🧮 Tokens: 1.2k in / 800 out");
|
expect(text).toContain("🧮 Tokens: 1.2k in / 800 out · 💵 Cost: $0.0020");
|
||||||
expect(text).toContain("💵 Cost: $0.0020");
|
|
||||||
expect(text).toContain("Context: 16k/32k (50%)");
|
expect(text).toContain("Context: 16k/32k (50%)");
|
||||||
expect(text).toContain("🧹 Compactions: 2");
|
expect(text).toContain("🧹 Compactions: 2");
|
||||||
expect(text).toContain("Session: agent:main:main");
|
expect(text).toContain("Session: agent:main:main");
|
||||||
|
|||||||
@@ -328,12 +328,13 @@ export function buildStatusMessage(args: StatusArgs): string {
|
|||||||
const versionLine = `🦞 ClawdBot ${VERSION}${commit ? ` (${commit})` : ""}`;
|
const versionLine = `🦞 ClawdBot ${VERSION}${commit ? ` (${commit})` : ""}`;
|
||||||
const usagePair = formatUsagePair(inputTokens, outputTokens);
|
const usagePair = formatUsagePair(inputTokens, outputTokens);
|
||||||
const costLine = costLabel ? `💵 Cost: ${costLabel}` : null;
|
const costLine = costLabel ? `💵 Cost: ${costLabel}` : null;
|
||||||
|
const usageCostLine =
|
||||||
|
usagePair && costLine ? `${usagePair} · ${costLine}` : usagePair ?? costLine;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
versionLine,
|
versionLine,
|
||||||
modelLine,
|
modelLine,
|
||||||
usagePair,
|
usageCostLine,
|
||||||
costLine,
|
|
||||||
`📚 ${contextLine}`,
|
`📚 ${contextLine}`,
|
||||||
args.usageLine,
|
args.usageLine,
|
||||||
`🧵 ${sessionLine}`,
|
`🧵 ${sessionLine}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user