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

推荐订阅源

美团技术团队
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Martin Fowler
Martin Fowler
雷峰网
雷峰网
IT之家
IT之家
小众软件
小众软件
M
MIT News - Artificial intelligence
博客园 - 聂微东
J
Java Code Geeks
Blog — PlanetScale
Blog — PlanetScale
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
A
About on SuperTechFans
G
Google Developers Blog
Engineering at Meta
Engineering at Meta
Recent Announcements
Recent Announcements
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The GitHub Blog
The GitHub Blog
F
Fortinet All Blogs
C
Check Point Blog
云风的 BLOG
云风的 BLOG
腾讯CDC
H
Help Net Security
Y
Y Combinator Blog
I
InfoQ

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(qqbot): guard silent-final tool flushing · openclaw/o...
vincentkoc · 2026-06-11 · via Recent Commits to openclaw:main

@@ -109,6 +109,7 @@ function makeInboundRuntime(): GatewayPluginRuntime["channel"]["inbound"] {

109109

function makeRuntime(params: {

110110

onFinalize?: (ctx: Record<string, unknown>) => void;

111111

isControlCommandMessage?: (text?: string, cfg?: unknown) => boolean;

112+

skipFreshSettledDelivery?: boolean;

112113

onDispatch?: (dispatcherOptions: {

113114

deliver: (

114115

payload: { text?: string; mediaUrl?: string; mediaUrls?: string[]; audioAsVoice?: boolean },

@@ -119,6 +120,7 @@ function makeRuntime(params: {

119120

info: { kind: string; reason: "empty" | "silent" | "heartbeat" },

120121

) => void;

121122

onSettled?: () => unknown;

123+

onFreshSettledDelivery?: () => unknown;

122124

}) => Promise<void>;

123125

onDeliver?: (

124126

deliver: (

@@ -160,6 +162,7 @@ function makeRuntime(params: {

160162

info: { kind: string; reason: "empty" | "silent" | "heartbeat" },

161163

) => void;

162164

onSettled?: () => unknown;

165+

onFreshSettledDelivery?: () => unknown;

163166

};

164167

}

165168

).dispatcherOptions;

@@ -169,6 +172,9 @@ function makeRuntime(params: {

169172

await params.onDeliver?.(dispatcherOptions.deliver);

170173

}

171174

await dispatcherOptions.onSettled?.();

175+

if (!params.skipFreshSettledDelivery) {

176+

await dispatcherOptions.onFreshSettledDelivery?.();

177+

}

172178

}),

173179

finalizeInboundContext: vi.fn((rawCtx: Record<string, unknown>) => {

174180

params.onFinalize?.(rawCtx);

@@ -478,6 +484,96 @@ describe("dispatchOutbound", () => {

478484

expect(sendMediaMock).not.toHaveBeenCalled();

479485

});

480486487+

it("waits for fresh settled delivery after a skipped silent block", async () => {

488+

vi.useFakeTimers();

489+

const runtime = makeRuntime({

490+

onDispatch: async ({ deliver, onSkip }) => {

491+

await deliver({ text: "visible tool message" }, { kind: "tool" });

492+

onSkip?.({ text: "NO_REPLY" }, { kind: "block", reason: "silent" });

493+

await vi.advanceTimersByTimeAsync(60_000);

494+

expect(sendTextMock).not.toHaveBeenCalled();

495+

},

496+

});

497+498+

await dispatchOutbound(makeInbound(), {

499+

runtime,

500+

cfg: {},

501+

account: { ...account, config: { streaming: false } },

502+

});

503+504+

expect(sendTextMock.mock.calls.map((call) => call[1])).toEqual(["visible tool message"]);

505+

expect(sendMediaMock).not.toHaveBeenCalled();

506+

});

507+508+

it("does not send stale tool fallback when fresh settled delivery is suppressed", async () => {

509+

vi.useFakeTimers();

510+

const runtime = makeRuntime({

511+

skipFreshSettledDelivery: true,

512+

onDispatch: async ({ deliver, onSkip }) => {

513+

await deliver({ text: "stale visible tool message" }, { kind: "tool" });

514+

onSkip?.({ text: "NO_REPLY" }, { kind: "block", reason: "silent" });

515+

},

516+

});

517+518+

await dispatchOutbound(makeInbound(), {

519+

runtime,

520+

cfg: {},

521+

account: { ...account, config: { streaming: false } },

522+

});

523+524+

expect(sendTextMock).not.toHaveBeenCalled();

525+

expect(sendMediaMock).not.toHaveBeenCalled();

526+

expect(vi.getTimerCount()).toBe(0);

527+

});

528+529+

it("bounds tool media flushes without racing the fallback timer", async () => {

530+

vi.useFakeTimers();

531+

sendMediaMock.mockImplementationOnce(() => new Promise(() => {}));

532+

sendMediaMock.mockImplementationOnce(() => new Promise(() => {}));

533+

const firstMediaUrl = "https://example.com/progress-1.png";

534+

const secondMediaUrl = "https://example.com/progress-2.png";

535+

const runtime = makeRuntime({

536+

onDispatch: async ({ deliver, onSkip }) => {

537+

await deliver({ mediaUrl: firstMediaUrl }, { kind: "tool" });

538+

await deliver({ mediaUrl: secondMediaUrl }, { kind: "tool" });

539+

await deliver({ text: "visible tool message" }, { kind: "tool" });

540+

onSkip?.({ text: "NO_REPLY" }, { kind: "block", reason: "silent" });

541+

},

542+

});

543+544+

const dispatchPromise = dispatchOutbound(makeInbound(), {

545+

runtime,

546+

cfg: {},

547+

account: { ...account, config: { streaming: false } },

548+

});

549+550+

await vi.advanceTimersByTimeAsync(90_000);

551+

await dispatchPromise;

552+553+

expect(sendMediaMock).toHaveBeenCalledTimes(2);

554+

expect(sendTextMock.mock.calls.map((call) => call[1])).toEqual(["visible tool message"]);

555+

});

556+557+

it("clears the media timeout after a successful silent-final flush", async () => {

558+

vi.useFakeTimers();

559+

const mediaUrl = "https://example.com/progress.png";

560+

const runtime = makeRuntime({

561+

onDispatch: async ({ deliver, onSkip }) => {

562+

await deliver({ mediaUrl }, { kind: "tool" });

563+

onSkip?.({ text: "NO_REPLY" }, { kind: "block", reason: "silent" });

564+

},

565+

});

566+567+

await dispatchOutbound(makeInbound(), {

568+

runtime,

569+

cfg: {},

570+

account: { ...account, config: { streaming: false } },

571+

});

572+573+

expect(sendMediaMock).toHaveBeenCalledTimes(1);

574+

expect(vi.getTimerCount()).toBe(0);

575+

});

576+481577

it.each([

482578

{ name: "empty text", payload: {} },

483579

{ name: "silent token", payload: { text: "NO_REPLY" } },