惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

人人都是产品经理
人人都是产品经理
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
宝玉的分享
宝玉的分享
月光博客
月光博客
爱范儿
爱范儿
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
阮一峰的网络日志
阮一峰的网络日志
博客园_首页
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
博客园 - 聂微东
小众软件
小众软件
量子位
MongoDB | Blog
MongoDB | Blog
Blog — PlanetScale
Blog — PlanetScale
The Cloudflare Blog
Stack Overflow Blog
Stack Overflow Blog
U
Unit 42
Hugging Face - Blog
Hugging Face - Blog
T
The Blog of Author Tim Ferriss
H
Help Net Security
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
test: tighten usage command assertions · openclaw/opencla...
steipete · 2026-05-11 · via Recent Commits to openclaw:main

@@ -104,6 +104,16 @@ function buildCostTotals(overrides: Partial<CostUsageTotals> = {}): CostUsageTot

104104

};

105105

}

106106107+

function expectSessionCostArgs(): Record<string, unknown> {

108+

expect(loadSessionCostSummaryMock).toHaveBeenCalledTimes(1);

109+

return (loadSessionCostSummaryMock.mock.calls[0] as unknown as [Record<string, unknown>])[0];

110+

}

111+112+

function expectFastModeArgs(): Record<string, unknown> {

113+

expect(resolveFastModeStateMock).toHaveBeenCalledTimes(1);

114+

return (resolveFastModeStateMock.mock.calls[0] as unknown as [Record<string, unknown>])[0];

115+

}

116+107117

describe("handleUsageCommand", () => {

108118

beforeEach(() => {

109119

vi.clearAllMocks();

@@ -130,12 +140,9 @@ describe("handleUsageCommand", () => {

130140

const result = await handleUsageCommand(buildUsageParams(), true);

131141132142

expect(result?.shouldContinue).toBe(false);

133-

expect(loadSessionCostSummaryMock).toHaveBeenCalledWith(

134-

expect.objectContaining({

135-

agentId: "target",

136-

sessionId: "session-1",

137-

}),

138-

);

143+

const args = expectSessionCostArgs();

144+

expect(args.agentId).toBe("target");

145+

expect(args.sessionId).toBe("session-1");

139146

});

140147141148

it("prefers the target session entry from sessionStore for /usage cost", async () => {

@@ -155,12 +162,9 @@ describe("handleUsageCommand", () => {

155162156163

await handleUsageCommand(params, true);

157164158-

expect(loadSessionCostSummaryMock).toHaveBeenCalledWith(

159-

expect.objectContaining({

160-

sessionId: "target-session",

161-

sessionFile: "/tmp/target-session.jsonl",

162-

}),

163-

);

165+

const args = expectSessionCostArgs();

166+

expect(args.sessionId).toBe("target-session");

167+

expect(args.sessionFile).toBe("/tmp/target-session.jsonl");

164168

});

165169166170

it("prefers the target session entry from sessionStore for /usage footer mode", async () => {

@@ -202,13 +206,10 @@ describe("handleFastCommand", () => {

202206

const result = await handleFastCommand(params, true);

203207204208

expect(result?.shouldContinue).toBe(false);

205-

expect(resolveFastModeStateMock).toHaveBeenCalledWith(

206-

expect.objectContaining({

207-

agentId: "target",

208-

provider: "openai",

209-

model: "gpt-5.4",

210-

}),

211-

);

209+

const args = expectFastModeArgs();

210+

expect(args.agentId).toBe("target");

211+

expect(args.provider).toBe("openai");

212+

expect(args.model).toBe("gpt-5.4");

212213

expect(result?.reply?.text).toContain("Current fast mode: on");

213214

});

214215

@@ -232,14 +233,10 @@ describe("handleFastCommand", () => {

232233233234

await handleFastCommand(params, true);

234235235-

expect(resolveFastModeStateMock).toHaveBeenCalledWith(

236-

expect.objectContaining({

237-

sessionEntry: expect.objectContaining({

238-

sessionId: "target-session",

239-

fastMode: true,

240-

}),

241-

}),

242-

);

236+

const args = expectFastModeArgs();

237+

const sessionEntry = args.sessionEntry as Record<string, unknown> | undefined;

238+

expect(sessionEntry?.sessionId).toBe("target-session");

239+

expect(sessionEntry?.fastMode).toBe(true);

243240

});

244241245242

it("clears fast mode for /fast default", async () => {