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

推荐订阅源

A
About on SuperTechFans
GbyAI
GbyAI
I
InfoQ
C
Cisco Blogs
T
Tor Project blog
NISL@THU
NISL@THU
N
Netflix TechBlog - Medium
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
T
The Exploit Database - CXSecurity.com
H
Help Net Security
Cisco Talos Blog
Cisco Talos Blog
The Register - Security
The Register - Security
Microsoft Azure Blog
Microsoft Azure Blog
G
Google Developers Blog
A
Arctic Wolf
Stack Overflow Blog
Stack Overflow Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
P
Palo Alto Networks Blog
aimingoo的专栏
aimingoo的专栏
Microsoft Security Blog
Microsoft Security Blog
P
Privacy International News Feed
L
LINUX DO - 热门话题
Know Your Adversary
Know Your Adversary
L
LangChain Blog
AWS News Blog
AWS News Blog
Security Latest
Security Latest
T
Threat Research - Cisco Blogs
U
Unit 42
P
Privacy & Cybersecurity Law Blog
Spread Privacy
Spread Privacy
WordPress大学
WordPress大学
Latest news
Latest news
L
Lohrmann on Cybersecurity
小众软件
小众软件
阮一峰的网络日志
阮一峰的网络日志
Simon Willison's Weblog
Simon Willison's Weblog
雷峰网
雷峰网
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Y
Y Combinator Blog
S
SegmentFault 最新的问题
Recent Announcements
Recent Announcements
C
Cybersecurity and Infrastructure Security Agency CISA
Martin Fowler
Martin Fowler
S
Schneier on Security
C
CERT Recently Published Vulnerability Notes
B
Blog
Project Zero
Project Zero
Recorded Future
Recorded Future

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: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
fix(gateway): defer agent dispatch after accept · openclaw/openclaw@9850000
vincentkoc · 2026-04-29 · via Recent Commits to openclaw:main

@@ -183,6 +183,37 @@ async function waitForAssertion(assertion: () => void, timeoutMs = 2_000, stepMs

183183

}

184184

}

185185186+

async function flushScheduledDispatchStep() {

187+

await Promise.resolve();

188+

if (vi.isFakeTimers()) {

189+

await vi.runOnlyPendingTimersAsync();

190+

} else {

191+

await new Promise<void>((resolve) => setTimeout(resolve, 15));

192+

}

193+

await Promise.resolve();

194+

}

195+196+

async function waitForAcceptedRunDispatch(respond: ReturnType<typeof vi.fn>) {

197+

const accepted = respond.mock.calls.some(([ok, payload]) => {

198+

return ok === true && (payload as { status?: string } | undefined)?.status === "accepted";

199+

});

200+

if (!accepted) {

201+

return;

202+

}

203+204+

const commandCallCount = mocks.agentCommand.mock.calls.length;

205+

const respondCallCount = respond.mock.calls.length;

206+

for (let attempt = 0; attempt < 50; attempt++) {

207+

await flushScheduledDispatchStep();

208+

if (

209+

mocks.agentCommand.mock.calls.length > commandCallCount ||

210+

respond.mock.calls.length > respondCallCount

211+

) {

212+

return;

213+

}

214+

}

215+

}

216+186217

function mockMainSessionEntry(entry: Record<string, unknown>, cfg: Record<string, unknown> = {}) {

187218

mocks.loadSessionEntry.mockReturnValue({

188219

cfg,

@@ -317,6 +348,7 @@ async function invokeAgent(

317348

context?: GatewayRequestContext;

318349

client?: AgentHandlerArgs["client"];

319350

isWebchatConnect?: AgentHandlerArgs["isWebchatConnect"];

351+

flushDispatch?: boolean;

320352

},

321353

) {

322354

const respond = options?.respond ?? vi.fn();

@@ -328,6 +360,9 @@ async function invokeAgent(

328360

client: options?.client ?? null,

329361

isWebchatConnect: options?.isWebchatConnect ?? (() => false),

330362

});

363+

if (options?.flushDispatch !== false) {

364+

await waitForAcceptedRunDispatch(respond);

365+

}

331366

return respond;

332367

}

333368

@@ -1717,19 +1752,19 @@ describe("gateway agent handler", () => {

17171752

meta: { durationMs: 100 },

17181753

});

17191754

const respond = vi.fn();

1720-

await agentHandlers.agent({

1721-

params: {

1755+

await invokeAgent(

1756+

{

17221757

message: "do thing",

17231758

sessionKey: "main",

17241759

voiceWakeTrigger: "robot wake",

17251760

idempotencyKey: "test-voice-route",

17261761

},

1727-

respond,

1728-

context: makeContext(),

1729-

req: { type: "req", id: "voice-1", method: "agent" },

1730-

client: null,

1731-

isWebchatConnect: () => false,

1732-

});

1762+

{

1763+

respond,

1764+

context: makeContext(),

1765+

reqId: "voice-1",

1766+

},

1767+

);

1733176817341769

await vi.waitFor(() => expect(mocks.agentCommand).toHaveBeenCalled());

17351770

const callArgs = mocks.agentCommand.mock.calls.at(-1)?.[0] as { sessionKey?: string };

@@ -1761,19 +1796,19 @@ describe("gateway agent handler", () => {

17611796

});

1762179717631798

const respond = vi.fn();

1764-

await agentHandlers.agent({

1765-

params: {

1799+

await invokeAgent(

1800+

{

17661801

message: "do thing",

17671802

sessionKey: "main",

17681803

voiceWakeTrigger: "robot wake",

17691804

idempotencyKey: "test-voice-route-unknown",

17701805

},

1771-

respond,

1772-

context: makeContext(),

1773-

req: { type: "req", id: "voice-2", method: "agent" },

1774-

client: null,

1775-

isWebchatConnect: () => false,

1776-

});

1806+

{

1807+

respond,

1808+

context: makeContext(),

1809+

reqId: "voice-2",

1810+

},

1811+

);

1777181217781813

await vi.waitFor(() => expect(mocks.agentCommand).toHaveBeenCalled());

17791814

const callArgs = mocks.agentCommand.mock.calls.at(-1)?.[0] as { sessionKey?: string };

@@ -1805,19 +1840,19 @@ describe("gateway agent handler", () => {

18051840

});

1806184118071842

const respond = vi.fn();

1808-

await agentHandlers.agent({

1809-

params: {

1843+

await invokeAgent(

1844+

{

18101845

message: "do thing",

18111846

sessionKey: "main",

18121847

voiceWakeTrigger: " ",

18131848

idempotencyKey: "test-voice-route-default-target",

18141849

},

1815-

respond,

1816-

context: makeContext(),

1817-

req: { type: "req", id: "voice-3", method: "agent" },

1818-

client: null,

1819-

isWebchatConnect: () => false,

1820-

});

1850+

{

1851+

respond,

1852+

context: makeContext(),

1853+

reqId: "voice-3",

1854+

},

1855+

);

1821185618221857

await vi.waitFor(() => expect(mocks.agentCommand).toHaveBeenCalled());

18231858

const callArgs = mocks.agentCommand.mock.calls.at(-1)?.[0] as { sessionKey?: string };

@@ -1853,21 +1888,21 @@ describe("gateway agent handler", () => {

18531888

});

1854188918551890

const respond = vi.fn();

1856-

await agentHandlers.agent({

1857-

params: {

1891+

await invokeAgent(

1892+

{

18581893

message: "do thing",

18591894

sessionKey: "main",

18601895

to: " ",

18611896

replyTo: " ",

18621897

voiceWakeTrigger: "robot wake",

18631898

idempotencyKey: "test-voice-route-whitespace-delivery",

18641899

},

1865-

respond,

1866-

context: makeContext(),

1867-

req: { type: "req", id: "voice-4", method: "agent" },

1868-

client: null,

1869-

isWebchatConnect: () => false,

1870-

});

1900+

{

1901+

respond,

1902+

context: makeContext(),

1903+

reqId: "voice-4",

1904+

},

1905+

);

1871190618721907

await vi.waitFor(() => expect(mocks.agentCommand).toHaveBeenCalled());

18731908

const callArgs = mocks.agentCommand.mock.calls.at(-1)?.[0] as { sessionKey?: string };

@@ -1905,19 +1940,19 @@ describe("gateway agent handler", () => {

19051940

mocks.resolveVoiceWakeRouteByTrigger.mockClear();

1906194119071942

const respond = vi.fn();

1908-

await agentHandlers.agent({

1909-

params: {

1943+

await invokeAgent(

1944+

{

19101945

message: "do thing",

19111946

sessionKey: "agent:main:research",

19121947

voiceWakeTrigger: "robot wake",

19131948

idempotencyKey: "test-voice-route-explicit-session",

19141949

},

1915-

respond,

1916-

context: makeContext(),

1917-

req: { type: "req", id: "voice-5", method: "agent" },

1918-

client: null,

1919-

isWebchatConnect: () => false,

1920-

});

1950+

{

1951+

respond,

1952+

context: makeContext(),

1953+

reqId: "voice-5",

1954+

},

1955+

);

1921195619221957

await vi.waitFor(() => expect(mocks.agentCommand).toHaveBeenCalled());

19231958

const callArgs = mocks.agentCommand.mock.calls.at(-1)?.[0] as { sessionKey?: string };

@@ -1953,19 +1988,19 @@ describe("gateway agent handler", () => {

19531988

mocks.resolveVoiceWakeRouteByTrigger.mockClear();

1954198919551990

const respond = vi.fn();

1956-

await agentHandlers.agent({

1957-

params: {

1991+

await invokeAgent(

1992+

{

19581993

message: "do thing",

19591994

sessionKey: "agent:ops:main",

19601995

voiceWakeTrigger: "robot wake",

19611996

idempotencyKey: "test-voice-route-explicit-other-agent-main",

19621997

},

1963-

respond,

1964-

context: makeContext(),

1965-

req: { type: "req", id: "voice-5b", method: "agent" },

1966-

client: null,

1967-

isWebchatConnect: () => false,

1968-

});

1998+

{

1999+

respond,

2000+

context: makeContext(),

2001+

reqId: "voice-5b",

2002+

},

2003+

);

1969200419702005

await vi.waitFor(() => expect(mocks.agentCommand).toHaveBeenCalled());

19712006

const callArgs = mocks.agentCommand.mock.calls.at(-1)?.[0] as { sessionKey?: string };

@@ -2001,20 +2036,20 @@ describe("gateway agent handler", () => {

20012036

mocks.resolveVoiceWakeRouteByTrigger.mockClear();

2002203720032038

const respond = vi.fn();

2004-

await agentHandlers.agent({

2005-

params: {

2039+

await invokeAgent(

2040+

{

20062041

message: "do thing",

20072042

sessionKey: "main",

20082043

sessionId: "caller-selected-session-id",

20092044

voiceWakeTrigger: "robot wake",

20102045

idempotencyKey: "test-voice-route-explicit-session-id",

20112046

},

2012-

respond,

2013-

context: makeContext(),

2014-

req: { type: "req", id: "voice-6", method: "agent" },

2015-

client: null,

2016-

isWebchatConnect: () => false,

2017-

});

2047+

{

2048+

respond,

2049+

context: makeContext(),

2050+

reqId: "voice-6",

2051+

},

2052+

);

2018205320192054

await vi.waitFor(() => expect(mocks.agentCommand).toHaveBeenCalled());

20202055

const callArgs = mocks.agentCommand.mock.calls.at(-1)?.[0] as { sessionKey?: string };

@@ -2504,7 +2539,7 @@ describe("gateway agent handler chat.abort integration", () => {

25042539

sessionKey: "agent:main:main",

25052540

idempotencyKey: runId,

25062541

},

2507-

{ respond, reqId: runId },

2542+

{ respond, reqId: runId, flushDispatch: false },

25082543

);

2509254425102545

await Promise.resolve();

@@ -2521,7 +2556,9 @@ describe("gateway agent handler chat.abort integration", () => {

25212556

);

25222557

expect(mocks.agentCommand).not.toHaveBeenCalled();

252325582524-

await new Promise((resolve) => setImmediate(resolve));

2559+

await new Promise<void>((resolve) => setImmediate(resolve));

2560+

expect(mocks.agentCommand).not.toHaveBeenCalled();

2561+

await new Promise<void>((resolve) => setTimeout(resolve, 15));

25252562

await pending;

2526256325272564

expect(mocks.agentCommand).toHaveBeenCalledTimes(1);

@@ -2725,20 +2762,25 @@ describe("gateway agent handler chat.abort integration", () => {

2725276227262763

const context = makeContext();

27272764

const runId = "idem-abort-reactivation-fails";

2728-

await expect(

2729-

invokeAgent(

2730-

{

2731-

message: "hi",

2732-

agentId: "main",

2733-

sessionKey: "agent:main:main",

2734-

idempotencyKey: runId,

2735-

},

2736-

{ context, reqId: runId },

2737-

),

2738-

).rejects.toThrow("reactivate boom");

2765+

const respond = vi.fn();

2766+

await invokeAgent(

2767+

{

2768+

message: "hi",

2769+

agentId: "main",

2770+

sessionKey: "agent:main:main",

2771+

idempotencyKey: runId,

2772+

},

2773+

{ context, reqId: runId, respond },

2774+

);

2739277527402776

expect(context.chatAbortControllers.has(runId)).toBe(false);

27412777

expect(mocks.agentCommand).not.toHaveBeenCalled();

2778+

expect(respond).toHaveBeenCalledWith(

2779+

false,

2780+

expect.objectContaining({ runId, status: "error" }),

2781+

expect.objectContaining({ code: "UNAVAILABLE" }),

2782+

expect.objectContaining({ runId }),

2783+

);

27422784

});

2743278527442786

it("does not overwrite or evict a pre-existing chatAbortControllers entry with the same runId", async () => {