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

推荐订阅源

N
Netflix TechBlog - Medium
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
爱范儿
爱范儿
量子位
博客园 - 聂微东
Engineering at Meta
Engineering at Meta
WordPress大学
WordPress大学
GbyAI
GbyAI
MyScale Blog
MyScale Blog
IT之家
IT之家
P
Proofpoint News Feed
M
MIT News - Artificial intelligence
The Cloudflare Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Hugging Face - Blog
Hugging Face - Blog
The Register - Security
The Register - Security
Microsoft Security Blog
Microsoft Security Blog
博客园_首页
MongoDB | Blog
MongoDB | Blog
F
Fortinet All Blogs
博客园 - 三生石上(FineUI控件)
Y
Y Combinator Blog
雷峰网
雷峰网
V
Visual Studio Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Last Week in AI
Last Week in AI
博客园 - 叶小钗
D
DataBreaches.Net
B
Blog
B
Blog RSS Feed
大猫的无限游戏
大猫的无限游戏
aimingoo的专栏
aimingoo的专栏
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The GitHub Blog
The GitHub Blog
云风的 BLOG
云风的 BLOG
Recent Announcements
Recent Announcements
阮一峰的网络日志
阮一峰的网络日志
小众软件
小众软件
腾讯CDC
T
Threat Research - Cisco Blogs
SecWiki News
SecWiki News
Martin Fowler
Martin Fowler
D
Docker
Cisco Talos Blog
Cisco Talos Blog
T
Tenable Blog
Webroot Blog
Webroot 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 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
improve: speed up provider tool-call streaming (#95957) · openclaw/openclaw@77d0dee
vincentkoc · 2026-06-23 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -547,6 +547,62 @@ describe("google transport stream", () => {

547547

]);

548548

});

549549
550+

it("keeps duplicate tool-call ids distinct while retaining the first signature", async () => {

551+

guardedFetchMock.mockResolvedValueOnce(

552+

buildSseResponse([

553+

{

554+

candidates: [

555+

{

556+

content: {

557+

parts: [

558+

{

559+

functionCall: {

560+

id: "call_1",

561+

name: "first",

562+

args: { value: 1 },

563+

},

564+

thoughtSignature: "first_signature",

565+

},

566+

{

567+

functionCall: {

568+

id: "call_1",

569+

name: "second",

570+

args: { value: 2 },

571+

},

572+

},

573+

],

574+

},

575+

finishReason: "STOP",

576+

},

577+

],

578+

},

579+

]),

580+

);

581+
582+

const streamFn = createGoogleGenerativeAiTransportStreamFn();

583+

const stream = await Promise.resolve(

584+

streamFn(buildGeminiModel(), {

585+

messages: [{ role: "user", content: "hello", timestamp: 0 }],

586+

} as never),

587+

);

588+

const result = await stream.result();

589+

const toolCalls = result.content.filter((block) => block.type === "toolCall");

590+
591+

expect(toolCalls).toHaveLength(2);

592+

expect(toolCalls[0]).toMatchObject({

593+

id: "call_1",

594+

name: "first",

595+

arguments: { value: 1 },

596+

thoughtSignature: "first_signature",

597+

});

598+

expect(toolCalls[1]).toMatchObject({

599+

name: "second",

600+

arguments: { value: 2 },

601+

thoughtSignature: "first_signature",

602+

});

603+

expect(toolCalls[1]?.id).not.toBe("call_1");

604+

});

605+
550606

it("keeps explicit thinking signatures after tool-call SSE parts", async () => {

551607

guardedFetchMock.mockResolvedValueOnce(

552608

buildSseResponse([

Original file line numberDiff line numberDiff line change

@@ -1266,6 +1266,10 @@ function createGoogleTransportStreamFn(kind: CanonicalGoogleTransportApi): Strea

12661266

});

12671267

stream.push({ type: "start", partial: output as never });

12681268

let currentBlockIndex = -1;

1269+

const toolCallBlocksById = new Map<

1270+

string,

1271+

Extract<GoogleTransportContentBlock, { type: "toolCall" }>

1272+

>();

12691273

const chunks =

12701274

sse.firstChunk === undefined

12711275

? sse.chunks

@@ -1356,18 +1360,9 @@ function createGoogleTransportStreamFn(kind: CanonicalGoogleTransportApi): Strea

13561360

currentBlockIndex = -1;

13571361

}

13581362

const providedId = part.functionCall.id;

1359-

const isDuplicate = output.content.some(

1360-

(block) => block.type === "toolCall" && block.id === providedId,

1361-

);

13621363

const existingToolCall =

1363-

typeof providedId === "string"

1364-

? output.content.find(

1365-

(

1366-

block,

1367-

): block is Extract<GoogleTransportContentBlock, { type: "toolCall" }> =>

1368-

block.type === "toolCall" && block.id === providedId,

1369-

)

1370-

: undefined;

1364+

typeof providedId === "string" ? toolCallBlocksById.get(providedId) : undefined;

1365+

const isDuplicate = existingToolCall !== undefined;

13711366

const toolCallId =

13721367

providedId && !isDuplicate

13731368

? providedId

@@ -1383,6 +1378,9 @@ function createGoogleTransportStreamFn(kind: CanonicalGoogleTransportApi): Strea

13831378

),

13841379

};

13851380

output.content.push(toolCall);

1381+

if (!toolCallBlocksById.has(toolCall.id)) {

1382+

toolCallBlocksById.set(toolCall.id, toolCall);

1383+

}

13861384

const blockIndex = output.content.length - 1;

13871385

stream.push({

13881386

type: "toolcall_start",

Original file line numberDiff line numberDiff line change

@@ -135,6 +135,62 @@ describe("consumeGoogleGenerateContentStream", () => {

135135

});

136136

expect(output.usage.cost.total).toBeGreaterThan(0);

137137

});

138+
139+

it("generates a new id when Google repeats a streamed tool-call id", async () => {

140+

const output = createOutput();

141+

const stream = new AssistantMessageEventStream();

142+

const events: string[] = [];

143+

const collect = (async () => {

144+

for await (const event of stream) {

145+

events.push(event.type);

146+

}

147+

})();

148+
149+

await consumeGoogleGenerateContentStream({

150+

chunks: chunks([

151+

{

152+

candidates: [

153+

{

154+

content: {

155+

parts: [{ functionCall: { id: "call_1", name: "lookup", args: {} } }],

156+

},

157+

},

158+

],

159+

} as GenerateContentResponse,

160+

{

161+

candidates: [

162+

{

163+

content: {

164+

parts: [{ functionCall: { id: "call_1", name: "lookup", args: {} } }],

165+

},

166+

finishReason: FinishReason.STOP,

167+

},

168+

],

169+

} as GenerateContentResponse,

170+

]),

171+

model,

172+

output,

173+

stream,

174+

nextToolCallId: (name) => `generated-${name}`,

175+

});

176+

await collect;

177+
178+

expect(events.at(-1)).toBe("done");

179+

expect(output.content).toEqual([

180+

{

181+

type: "toolCall",

182+

id: "call_1",

183+

name: "lookup",

184+

arguments: {},

185+

},

186+

{

187+

type: "toolCall",

188+

id: "generated-lookup",

189+

name: "lookup",

190+

arguments: {},

191+

},

192+

]);

193+

});

138194

});

139195
140196

describe("buildGoogleGenerateContentParams", () => {

Original file line numberDiff line numberDiff line change

@@ -750,6 +750,12 @@ export async function consumeGoogleGenerateContentStream<T extends GoogleApiType

750750

params.stream.push({ type: "start", partial: params.output });

751751

let currentBlock: TextContent | ThinkingContent | null = null;

752752

const blocks = params.output.content;

753+

const toolCallIds = new Set<string>();

754+

for (const block of blocks) {

755+

if (block.type === "toolCall") {

756+

toolCallIds.add(block.id);

757+

}

758+

}

753759

const blockIndex = () => blocks.length - 1;

754760
755761

const endCurrentBlock = () => {

@@ -835,11 +841,7 @@ export async function consumeGoogleGenerateContentStream<T extends GoogleApiType

835841

if (part.functionCall) {

836842

endCurrentBlock();

837843

const providedId = part.functionCall.id;

838-

const needsNewId =

839-

!providedId ||

840-

params.output.content.some(

841-

(block) => block.type === "toolCall" && block.id === providedId,

842-

);

844+

const needsNewId = !providedId || toolCallIds.has(providedId);

843845

const toolCall: ToolCall = {

844846

type: "toolCall",

845847

id: needsNewId ? params.nextToolCallId(part.functionCall.name) : providedId,

@@ -849,6 +851,7 @@ export async function consumeGoogleGenerateContentStream<T extends GoogleApiType

849851

};

850852
851853

params.output.content.push(toolCall);

854+

toolCallIds.add(toolCall.id);

852855

params.stream.push({

853856

type: "toolcall_start",

854857

contentIndex: blockIndex(),

Original file line numberDiff line numberDiff line change

@@ -874,6 +874,57 @@ describe("openai-completions stop-reason tool-call guard", () => {

874874

expect(eventTypes.filter((type) => type === "thinking_end")).toHaveLength(1);

875875

});

876876
877+

it("attaches encrypted reasoning details to the matching streamed tool call", async () => {

878+

mockChunksRef.chunks = [

879+

makeToolCallChunk("call_1", "first", '{"value":1}'),

880+

{

881+

id: "chatcmpl-test",

882+

choices: [

883+

{

884+

index: 0,

885+

delta: {

886+

tool_calls: [

887+

{

888+

index: 1,

889+

id: "call_2",

890+

function: { name: "second", arguments: '{"value":2}' },

891+

type: "function",

892+

},

893+

],

894+

reasoning_details: [

895+

{

896+

type: "reasoning.encrypted",

897+

id: "call_1",

898+

data: "encrypted",

899+

},

900+

],

901+

} as OpenAICompatibleDelta & {

902+

reasoning_details: Array<Record<string, string>>;

903+

},

904+

},

905+

],

906+

},

907+

makeFinishChunk("tool_calls"),

908+

];

909+
910+

const stream = streamOpenAICompletions(model, context, {

911+

apiKey: "sk-test",

912+

});

913+

const result = await stream.result();

914+

const toolCalls = result.content.filter((block) => block.type === "toolCall");

915+
916+

expect(toolCalls).toHaveLength(2);

917+

expect(toolCalls[0]).toMatchObject({

918+

id: "call_1",

919+

thoughtSignature: JSON.stringify({

920+

type: "reasoning.encrypted",

921+

id: "call_1",

922+

data: "encrypted",

923+

}),

924+

});

925+

expect(toolCalls[1]).not.toHaveProperty("thoughtSignature");

926+

});

927+
877928

it("keeps one native reasoning block when content and reasoning co-occur", async () => {

878929

mockChunksRef.chunks = [

879930

{

Original file line numberDiff line numberDiff line change

@@ -186,6 +186,7 @@ export const streamOpenAICompletions: StreamFunction<

186186

let hasFinishReason = false;

187187

const toolCallBlocksByIndex = new Map<number, StreamingToolCallBlock>();

188188

const toolCallBlocksById = new Map<string, StreamingToolCallBlock>();

189+

const toolCallBlocksByFirstId = new Map<string, StreamingToolCallBlock>();

189190

const blocks = output.content as StreamingBlock[];

190191

// A block can be finished mid-stream (native reasoning sealed at the

191192

// text-lane transition) and again by the end-of-stream loop; guard so its

@@ -197,6 +198,11 @@ export const streamOpenAICompletions: StreamFunction<

197198

blocks.push(block);

198199

};

199200

const getContentIndex = (block: StreamingBlock) => contentIndices.get(block) ?? -1;

201+

const rememberFirstToolCallById = (id: string, block: StreamingToolCallBlock) => {

202+

if (!toolCallBlocksByFirstId.has(id)) {

203+

toolCallBlocksByFirstId.set(id, block);

204+

}

205+

};

200206

const finishBlock = (block: StreamingBlock) => {

201207

const contentIndex = getContentIndex(block);

202208

if (contentIndex === -1 || finishedBlocks.has(block)) {

@@ -311,6 +317,7 @@ export const streamOpenAICompletions: StreamFunction<

311317

}

312318

if (toolCall.id) {

313319

toolCallBlocksById.set(toolCall.id, block);

320+

rememberFirstToolCallById(toolCall.id, block);

314321

}

315322

appendBlock(block);

316323

stream.push({

@@ -432,6 +439,7 @@ export const streamOpenAICompletions: StreamFunction<

432439

if (!block.id && toolCall.id) {

433440

block.id = toolCall.id;

434441

toolCallBlocksById.set(toolCall.id, block);

442+

rememberFirstToolCallById(toolCall.id, block);

435443

}

436444

if (!block.name && toolCall.function?.name) {

437445

block.name = toolCall.function.name;

@@ -457,9 +465,7 @@ export const streamOpenAICompletions: StreamFunction<

457465

if (reasoningDetails && Array.isArray(reasoningDetails)) {

458466

for (const detail of reasoningDetails) {

459467

if (detail.type === "reasoning.encrypted" && detail.id && detail.data) {

460-

const matchingToolCall = output.content.find(

461-

(b) => b.type === "toolCall" && b.id === detail.id,

462-

) as ToolCall | undefined;

468+

const matchingToolCall = toolCallBlocksByFirstId.get(detail.id);

463469

if (matchingToolCall) {

464470

matchingToolCall.thoughtSignature = JSON.stringify(detail);

465471

}