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

推荐订阅源

A
About on SuperTechFans
G
Google Developers Blog
L
LangChain Blog
aimingoo的专栏
aimingoo的专栏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
云风的 BLOG
云风的 BLOG
小众软件
小众软件
月光博客
月光博客
Recent Announcements
Recent Announcements
人人都是产品经理
人人都是产品经理
P
Proofpoint News Feed
博客园 - 聂微东
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
雷峰网
雷峰网
The Cloudflare Blog
博客园_首页
美团技术团队
大猫的无限游戏
大猫的无限游戏
B
Blog
IT之家
IT之家
Jina AI
Jina AI
H
Hackread – Cybersecurity News, Data Breaches, AI and More
C
Check Point Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

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(gateway): ignore stale abort markers for fresh chat e...
nxmxbbd · 2026-06-19 · via Recent Commits to openclaw:main

@@ -44,6 +44,7 @@ import {

4444

createAgentEventHandler,

4545

createChatRunState,

4646

createSessionEventSubscriberRegistry,

47+

createChatAbortMarker,

4748

createSessionMessageSubscriberRegistry,

4849

createToolEventRecipientRegistry,

4950

type AgentEventHandlerOptions,

@@ -2762,7 +2763,7 @@ describe("agent event handler", () => {

27622763

sessionKey: "session-aborted",

27632764

clientRunId: "client-aborted",

27642765

});

2765-

chatRunState.abortedRuns.set("client-aborted", 1_000);

2766+

chatRunState.abortedRuns.set("client-aborted", createChatAbortMarker());

2766276727672768

handler({

27682769

runId: "run-aborted",

@@ -2777,6 +2778,81 @@ describe("agent event handler", () => {

27772778

expect(chatBroadcastCalls(broadcast)).toHaveLength(0);

27782779

});

277927802781+

it.each([

2782+

{

2783+

name: "older timestamp",

2784+

marker: () => 1_000,

2785+

},

2786+

{

2787+

name: "same-millisecond older sequence",

2788+

marker: () => ({ abortedAtMs: 2_000, sequence: -1 }),

2789+

},

2790+

])(

2791+

"ignores stale aborted markers from older same-key runs for fresh chat lifecycle events ($name)",

2792+

({ marker }) => {

2793+

const { broadcast, nodeSendToSession, chatRunState, handler } = createHarness({ now: 2_000 });

2794+

chatRunState.abortedRuns.set("client-stale-abort", marker());

2795+

chatRunState.registry.add("run-stale-abort", {

2796+

sessionKey: "session-stale-abort",

2797+

clientRunId: "client-stale-abort",

2798+

});

2799+2800+

handler({

2801+

runId: "run-stale-abort",

2802+

seq: 1,

2803+

stream: "assistant",

2804+

ts: 2_100,

2805+

data: { text: "Fresh output", delta: "Fresh output" },

2806+

});

2807+

handler({

2808+

runId: "run-stale-abort",

2809+

seq: 2,

2810+

stream: "lifecycle",

2811+

ts: 2_200,

2812+

data: { phase: "end" },

2813+

});

2814+2815+

const chatCalls = chatBroadcastCalls(broadcast);

2816+

expect(chatCalls).toHaveLength(2);

2817+

const deltaPayload = chatCalls[0][1];

2818+

const finalPayload = chatCalls[1][1];

2819+

expect(deltaPayload.state).toBe("delta");

2820+

expect(finalPayload.state).toBe("final");

2821+

expect(sessionChatCalls(nodeSendToSession)).toHaveLength(2);

2822+

expect(chatRunState.abortedRuns.has("client-stale-abort")).toBe(true);

2823+

expect(chatRunState.registry.peek("run-stale-abort")).toBeUndefined();

2824+

},

2825+

);

2826+2827+

it("honors same-millisecond abort markers from the current same-key run", () => {

2828+

const { broadcast, nodeSendToSession, chatRunState, handler } = createHarness({ now: 3_000 });

2829+

chatRunState.registry.add("run-current-abort", {

2830+

sessionKey: "session-current-abort",

2831+

clientRunId: "client-current-abort",

2832+

});

2833+

chatRunState.abortedRuns.set("client-current-abort", createChatAbortMarker());

2834+2835+

handler({

2836+

runId: "run-current-abort",

2837+

seq: 1,

2838+

stream: "assistant",

2839+

ts: 3_100,

2840+

data: { text: "Suppressed output", delta: "Suppressed output" },

2841+

});

2842+

handler({

2843+

runId: "run-current-abort",

2844+

seq: 2,

2845+

stream: "lifecycle",

2846+

ts: 3_200,

2847+

data: { phase: "end", aborted: true, stopReason: "rpc" },

2848+

});

2849+2850+

expect(chatBroadcastCalls(broadcast)).toHaveLength(0);

2851+

expect(sessionChatCalls(nodeSendToSession)).toHaveLength(0);

2852+

expect(chatRunState.abortedRuns.has("client-current-abort")).toBe(true);

2853+

expect(chatRunState.registry.peek("run-current-abort")).toBeUndefined();

2854+

});

2855+27802856

it("keeps live session setting metadata at the top level for lifecycle updates", async () => {

27812857

vi.mocked(loadGatewaySessionRow).mockReturnValue({

27822858

key: "session-finished",

@@ -3166,7 +3242,7 @@ describe("agent event handler", () => {

31663242

data: { phase: "error", error: "provider failed" },

31673243

});

316832443169-

expect(chatRunState.registry.peek("run-fallback-retry")).toEqual({

3245+

expect(chatRunState.registry.peek("run-fallback-retry")).toMatchObject({

31703246

sessionKey: "session-fallback",

31713247

clientRunId: "run-fallback-client",

31723248

});

@@ -3189,7 +3265,7 @@ describe("agent event handler", () => {

3189326531903266

vi.advanceTimersByTime(100);

319132673192-

expect(chatRunState.registry.peek("run-fallback-retry")).toEqual({

3268+

expect(chatRunState.registry.peek("run-fallback-retry")).toMatchObject({

31933269

sessionKey: "session-fallback",

31943270

clientRunId: "run-fallback-client",

31953271

});