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

推荐订阅源

月光博客
月光博客
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
阮一峰的网络日志
阮一峰的网络日志
罗磊的独立博客
T
Tailwind CSS Blog
博客园_首页
博客园 - 司徒正美
Google DeepMind News
Google DeepMind News
Hugging Face - Blog
Hugging Face - Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
V2EX
J
Java Code Geeks
量子位
D
DataBreaches.Net
MongoDB | Blog
MongoDB | Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Microsoft Azure Blog
Microsoft Azure Blog
P
Proofpoint News Feed
C
Check Point Blog
V
Visual Studio Blog
H
Help Net Security
Recent Announcements
Recent Announcements
Engineering at Meta
Engineering at Meta

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(gemini): gate thought-signature replay trust · opencl...
steipete · 2026-05-07 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -542,6 +542,42 @@ describe("google transport stream", () => {

542542

});

543543

});

544544
545+

it("does not trust cross-provider tool-call thought signatures for non-Gemini-3 models", () => {

546+

const model = buildGeminiModel({

547+

id: "gemini-2.5-pro",

548+

name: "Gemini 2.5 Pro",

549+

});

550+
551+

const params = buildGoogleGenerativeAiParams(model, {

552+

messages: [

553+

{

554+

role: "assistant",

555+

provider: "anthropic",

556+

api: "anthropic-messages",

557+

model: "claude-opus-4-7",

558+

stopReason: "toolUse",

559+

timestamp: 0,

560+

content: [

561+

{

562+

type: "toolCall",

563+

id: "call_1",

564+

name: "lookup",

565+

arguments: { q: "hello" },

566+

thoughtSignature: "foreign_sig",

567+

},

568+

],

569+

},

570+

],

571+

} as never);

572+
573+

expect(params.contents[0]).toMatchObject({

574+

role: "model",

575+

parts: [{ functionCall: { name: "lookup", args: { q: "hello" } } }],

576+

});

577+

expect(JSON.stringify(params.contents)).not.toContain("foreign_sig");

578+

expect(JSON.stringify(params.contents)).not.toContain("skip_thought_signature_validator");

579+

});

580+
545581

it("builds direct Gemini payloads without negative fallback thinking budgets", () => {

546582

const model = {

547583

id: "custom-gemini-model",

Original file line numberDiff line numberDiff line change

@@ -386,7 +386,9 @@ function convertGoogleMessages(model: GoogleTransportModel, context: Context) {

386386

context.messages,

387387

model,

388388

(id) => (requiresToolCallId(model.id) ? normalizeToolCallId(id) : id),

389-

{ preserveCrossModelToolCallThoughtSignature: true },

389+

{

390+

preserveCrossModelToolCallThoughtSignature: requiresToolCallThoughtSignature(model.id),

391+

},

390392

);

391393

for (const msg of transformedMessages) {

392394

if (msg.role === "user") {

Original file line numberDiff line numberDiff line change

@@ -2980,6 +2980,53 @@ describe("openai transport stream", () => {

29802980

"skip_thought_signature_validator",

29812981

);

29822982

});

2983+
2984+

it("does not trust cross-route thought_signature for non-Gemini-3 Google compat models", () => {

2985+

const nonGemini3Model = {

2986+

...geminiModel,

2987+

id: "gemini-2.5-pro",

2988+

name: "Gemini 2.5 Pro",

2989+

};

2990+

const params = buildOpenAICompletionsParams(

2991+

nonGemini3Model,

2992+

{

2993+

messages: [

2994+

{

2995+

role: "assistant",

2996+

api: "google-generative-ai",

2997+

provider: nonGemini3Model.provider,

2998+

model: nonGemini3Model.id,

2999+

usage: {

3000+

input: 0,

3001+

output: 0,

3002+

cacheRead: 0,

3003+

cacheWrite: 0,

3004+

totalTokens: 0,

3005+

cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },

3006+

},

3007+

stopReason: "toolUse",

3008+

timestamp: 1,

3009+

content: [

3010+

{

3011+

type: "toolCall",

3012+

id: "call_abc",

3013+

name: "echo_value",

3014+

arguments: { value: "repro" },

3015+

thoughtSignature: "SIG-OPAQUE-ABC==",

3016+

},

3017+

],

3018+

},

3019+

],

3020+

tools: [],

3021+

} as never,

3022+

undefined,

3023+

) as { messages: Array<Record<string, unknown>> };

3024+
3025+

const assistant = params.messages.find((message) => message.role === "assistant") as

3026+

| { tool_calls?: Array<{ extra_content?: unknown }> }

3027+

| undefined;

3028+

expect(assistant?.tool_calls?.[0]?.extra_content).toBeUndefined();

3029+

});

29833030

});

29843031
29853032

it("uses Mistral compat defaults for direct Mistral completions providers", () => {

Original file line numberDiff line numberDiff line change

@@ -1836,6 +1836,9 @@ function injectToolCallThoughtSignatures(

18361836

source.api === model.api &&

18371837

source.provider === model.provider &&

18381838

source.model === model.id;

1839+

if (!isSameRoute && !fallbackSig) {

1840+

continue;

1841+

}

18391842

sigById.set(id, isSameRoute ? sig : (fallbackSig ?? sig));

18401843

}

18411844

}