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

推荐订阅源

腾讯CDC
N
Netflix TechBlog - Medium
aimingoo的专栏
aimingoo的专栏
P
Proofpoint News Feed
F
Fortinet All Blogs
大猫的无限游戏
大猫的无限游戏
I
InfoQ
V
V2EX
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
有赞技术团队
有赞技术团队
G
Google Developers Blog
L
LangChain Blog
博客园_首页
M
MIT News - Artificial intelligence
H
Hackread – Cybersecurity News, Data Breaches, AI and More
月光博客
月光博客
IT之家
IT之家
量子位
宝玉的分享
宝玉的分享
S
SegmentFault 最新的问题
Stack Overflow Blog
Stack Overflow Blog
V
Visual Studio Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
雷峰网
雷峰网

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 embedded tui event assertions · openclaw/op...
steipete · 2026-05-09 · via Recent Commits to openclaw:main

@@ -4,6 +4,7 @@ import { defaultRuntime } from "../runtime.js";

4455

const agentCommandFromIngressMock = vi.fn();

66

let registeredListener: ((evt: unknown) => void) | undefined;

7+

const embeddedEventTimestamp = Date.parse("2026-05-09T07:26:00.000Z");

7889

vi.mock("../agents/agent-command.js", () => ({

910

agentCommandFromIngress: (...args: unknown[]) => agentCommandFromIngressMock(...args),

@@ -135,6 +136,8 @@ describe("EmbeddedTuiBackend", () => {

135136

const originalRuntimeError = defaultRuntime.error;

136137137138

beforeEach(() => {

139+

vi.useFakeTimers();

140+

vi.setSystemTime(embeddedEventTimestamp);

138141

agentCommandFromIngressMock.mockReset();

139142

registeredListener = undefined;

140143

setEmbeddedMode(false);

@@ -143,6 +146,7 @@ describe("EmbeddedTuiBackend", () => {

143146

});

144147145148

afterEach(() => {

149+

vi.useRealTimers();

146150

setEmbeddedMode(false);

147151

defaultRuntime.log = originalRuntimeLog;

148152

defaultRuntime.error = originalRuntimeError;

@@ -206,7 +210,7 @@ describe("EmbeddedTuiBackend", () => {

206210

message: {

207211

role: "assistant",

208212

content: [{ type: "text", text: "hello" }],

209-

timestamp: expect.any(Number),

213+

timestamp: embeddedEventTimestamp,

210214

},

211215

},

212216

},

@@ -228,7 +232,7 @@ describe("EmbeddedTuiBackend", () => {

228232

message: {

229233

role: "assistant",

230234

content: [{ type: "text", text: "hello" }],

231-

timestamp: expect.any(Number),

235+

timestamp: embeddedEventTimestamp,

232236

},

233237

},

234238

},

@@ -274,22 +278,29 @@ describe("EmbeddedTuiBackend", () => {

274278

.filter((entry) => entry.event === "chat")

275279

.map(

276280

(entry) =>

277-

entry.payload as { state?: string; message?: { content?: Array<{ text?: string }> } },

281+

entry.payload as {

282+

runId?: string;

283+

sessionKey?: string;

284+

state?: string;

285+

stopReason?: string;

286+

message?: { content?: Array<{ text?: string }> };

287+

},

278288

);

279289

const nonEmptyDeltas = chatPayloads.filter(

280290

(payload) => payload.state === "delta" && payload.message?.content?.[0]?.text,

281291

);

282292

expect(nonEmptyDeltas).toHaveLength(0);

283-

expect(chatPayloads.at(-1)).toEqual(

284-

expect.objectContaining({

285-

state: "final",

286-

message: {

287-

role: "assistant",

288-

content: [{ type: "text", text: "No" }],

289-

timestamp: expect.any(Number),

290-

},

291-

}),

292-

);

293+

expect(chatPayloads.at(-1)).toStrictEqual({

294+

runId: "run-local-no",

295+

sessionKey: "agent:main:main",

296+

state: "final",

297+

stopReason: "stop",

298+

message: {

299+

role: "assistant",

300+

content: [{ type: "text", text: "No" }],

301+

timestamp: embeddedEventTimestamp,

302+

},

303+

});

293304

});

294305295306

it("emits side-result events for local /btw runs", async () => {

@@ -407,7 +418,7 @@ describe("EmbeddedTuiBackend", () => {

407418

message: {

408419

role: "assistant",

409420

content: [{ type: "text", text: "" }],

410-

timestamp: expect.any(Number),

421+

timestamp: embeddedEventTimestamp,

411422

},

412423

},

413424

},

@@ -428,7 +439,7 @@ describe("EmbeddedTuiBackend", () => {

428439

message: {

429440

role: "assistant",

430441

content: [{ type: "text", text: "done" }],

431-

timestamp: expect.any(Number),

442+

timestamp: embeddedEventTimestamp,

432443

},

433444

},

434445

},

@@ -484,11 +495,10 @@ describe("EmbeddedTuiBackend", () => {

484495

await flushMicrotasks();

485496486497

expect(agentCommandFromIngressMock).toHaveBeenCalledTimes(1);

487-

expect(agentCommandFromIngressMock.mock.calls[0]?.[0]).toEqual(

488-

expect.objectContaining({

489-

timeout: "300",

490-

}),

491-

);

498+

const ingressOptions = agentCommandFromIngressMock.mock.calls[0]?.[0] as

499+

| { timeout?: unknown }

500+

| undefined;

501+

expect(ingressOptions?.timeout).toBe("300");

492502

} finally {

493503

backend.stop();

494504

}