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

推荐订阅源

量子位
博客园_首页
Google DeepMind News
Google DeepMind News
博客园 - Franky
The GitHub Blog
The GitHub Blog
GbyAI
GbyAI
有赞技术团队
有赞技术团队
Microsoft Azure Blog
Microsoft Azure Blog
G
Google Developers Blog
Recent Announcements
Recent Announcements
A
About on SuperTechFans
博客园 - 【当耐特】
博客园 - 三生石上(FineUI控件)
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
罗磊的独立博客
IT之家
IT之家
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
Jina AI
Jina AI
腾讯CDC
P
Proofpoint News Feed
Hugging Face - Blog
Hugging Face - Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com

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
fix(ui): stream chat deltas incrementally · openclaw/open...
vincentkoc · 2026-06-01 · via Recent Commits to openclaw:main

@@ -224,6 +224,129 @@ describe("handleChatEvent", () => {

224224

expect(state.chatRunId).toBe("run-1");

225225

});

226226227+

it("appends gateway deltaText when the cumulative snapshot matches the current prefix", () => {

228+

const state = createState({

229+

sessionKey: "main",

230+

chatRunId: "run-1",

231+

chatStream: "Live",

232+

});

233+

const payload: ChatEventPayload = {

234+

runId: "run-1",

235+

sessionKey: "main",

236+

state: "delta",

237+

deltaText: " reply",

238+

message: {

239+

role: "assistant",

240+

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

241+

},

242+

};

243+244+

expect(handleChatEvent(state, payload)).toBe("delta");

245+

expect(state.chatStream).toBe("Live reply");

246+

});

247+248+

it("uses the cumulative snapshot when the first observed delta joins mid-stream", () => {

249+

const state = createState({

250+

sessionKey: "main",

251+

chatRunId: "run-1",

252+

chatStream: null,

253+

});

254+

const payload: ChatEventPayload = {

255+

runId: "run-1",

256+

sessionKey: "main",

257+

state: "delta",

258+

deltaText: " reply",

259+

message: {

260+

role: "assistant",

261+

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

262+

},

263+

};

264+265+

expect(handleChatEvent(state, payload)).toBe("delta");

266+

expect(state.chatStream).toBe("Live reply");

267+

});

268+269+

it("appends gateway deltaText when no full message snapshot is present", () => {

270+

const state = createState({

271+

sessionKey: "main",

272+

chatRunId: "run-1",

273+

chatStream: "Live",

274+

});

275+

const payload: ChatEventPayload = {

276+

runId: "run-1",

277+

sessionKey: "main",

278+

state: "delta",

279+

deltaText: " reply",

280+

};

281+282+

expect(handleChatEvent(state, payload)).toBe("delta");

283+

expect(state.chatStream).toBe("Live reply");

284+

});

285+286+

it("uses the cumulative snapshot when a missed delta would make append stale", () => {

287+

const state = createState({

288+

sessionKey: "main",

289+

chatRunId: "run-1",

290+

chatStream: "Hello",

291+

});

292+

const payload: ChatEventPayload = {

293+

runId: "run-1",

294+

sessionKey: "main",

295+

state: "delta",

296+

deltaText: "!",

297+

message: {

298+

role: "assistant",

299+

content: [{ type: "text", text: "Hello world!" }],

300+

},

301+

};

302+303+

expect(handleChatEvent(state, payload)).toBe("delta");

304+

expect(state.chatStream).toBe("Hello world!");

305+

});

306+307+

it("uses the cumulative snapshot when a same-length missed replacement changes the prefix", () => {

308+

const state = createState({

309+

sessionKey: "main",

310+

chatRunId: "run-1",

311+

chatStream: "AB",

312+

});

313+

const payload: ChatEventPayload = {

314+

runId: "run-1",

315+

sessionKey: "main",

316+

state: "delta",

317+

deltaText: "E",

318+

message: {

319+

role: "assistant",

320+

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

321+

},

322+

};

323+324+

expect(handleChatEvent(state, payload)).toBe("delta");

325+

expect(state.chatStream).toBe("CDE");

326+

});

327+328+

it("replaces the stream when gateway deltaText marks a replacement", () => {

329+

const state = createState({

330+

sessionKey: "main",

331+

chatRunId: "run-1",

332+

chatStream: "Alpha beta",

333+

});

334+

const payload: ChatEventPayload = {

335+

runId: "run-1",

336+

sessionKey: "main",

337+

state: "delta",

338+

deltaText: "Alpha",

339+

replace: true,

340+

message: {

341+

role: "assistant",

342+

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

343+

},

344+

};

345+346+

expect(handleChatEvent(state, payload)).toBe("delta");

347+

expect(state.chatStream).toBe("Alpha");

348+

});

349+227350

it("adopts the run id for selected-session live deltas observed from another channel", () => {

228351

const state = createState({

229352

sessionKey: "agent:main:feishu:direct:peer-1",