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

推荐订阅源

宝玉的分享
宝玉的分享
B
Blog RSS Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
MyScale Blog
MyScale Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
S
SegmentFault 最新的问题
Y
Y Combinator Blog
月光博客
月光博客
IT之家
IT之家
T
Tailwind CSS Blog
Last Week in AI
Last Week in AI
L
LangChain Blog
博客园_首页
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
博客园 - Franky
WordPress大学
WordPress大学
云风的 BLOG
云风的 BLOG
M
MIT News - Artificial intelligence
V
Visual Studio Blog
小众软件
小众软件
博客园 - 叶小钗
博客园 - 三生石上(FineUI控件)
N
Netflix TechBlog - Medium

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: Found one narrow regression risk in the new Ollama t...
clawsweeper · 2026-04-30 · via Recent Commits to openclaw:main

@@ -577,6 +577,48 @@ describe("convertToOllamaMessages", () => {

577577

]);

578578

});

579579580+

it("preserves exact allowlisted tool-prefix names before Ollama replay", () => {

581+

const messages = [

582+

{

583+

role: "assistant",

584+

content: [

585+

{ type: "toolCall", id: "call_1", name: "tool_a", arguments: { value: 1 } },

586+

{ type: "tool_use", id: "call_2", name: "tools_invoke_test", input: { value: 2 } },

587+

{ type: "toolCall", id: "call_3", name: "function-run", arguments: { value: 3 } },

588+

],

589+

},

590+

];

591+

const result = convertToOllamaMessages(messages, undefined, {

592+

availableToolNames: new Set(["tool_a", "tools_invoke_test", "function-run"]),

593+

});

594+

expect(result[0].tool_calls).toEqual([

595+

{ function: { name: "tool_a", arguments: { value: 1 } } },

596+

{ function: { name: "tools_invoke_test", arguments: { value: 2 } } },

597+

{ function: { name: "function-run", arguments: { value: 3 } } },

598+

]);

599+

});

600+601+

it("strips underscore and dash provider prefixes only when the suffix is allowlisted", () => {

602+

const messages = [

603+

{

604+

role: "assistant",

605+

content: [

606+

{ type: "toolCall", id: "call_1", name: "tools_exec", arguments: { command: "pwd" } },

607+

{ type: "tool_use", id: "call_2", name: "function-read", input: { path: "." } },

608+

{ type: "toolCall", id: "call_3", name: "tool_missing", arguments: {} },

609+

],

610+

},

611+

];

612+

const result = convertToOllamaMessages(messages, undefined, {

613+

availableToolNames: new Set(["exec", "read"]),

614+

});

615+

expect(result[0].tool_calls).toEqual([

616+

{ function: { name: "exec", arguments: { command: "pwd" } } },

617+

{ function: { name: "read", arguments: { path: "." } } },

618+

{ function: { name: "tool_missing", arguments: {} } },

619+

]);

620+

});

621+580622

it("keeps non-prefixed Ollama replay tool names intact", () => {

581623

const messages = [

582624

{

@@ -585,6 +627,7 @@ describe("convertToOllamaMessages", () => {

585627

{ type: "toolCall", id: "call_1", name: "functionshell", arguments: {} },

586628

{ type: "toolCall", id: "call_2", name: "tooling", arguments: {} },

587629

{ type: "toolCall", id: "call_3", name: "tools", arguments: {} },

630+

{ type: "toolCall", id: "call_4", name: "tool_a", arguments: {} },

588631

],

589632

},

590633

];

@@ -593,6 +636,7 @@ describe("convertToOllamaMessages", () => {

593636

{ function: { name: "functionshell", arguments: {} } },

594637

{ function: { name: "tooling", arguments: {} } },

595638

{ function: { name: "tools", arguments: {} } },

639+

{ function: { name: "tool_a", arguments: {} } },

596640

]);

597641

});

598642

@@ -825,6 +869,39 @@ describe("buildAssistantMessage", () => {

825869

]);

826870

});

827871872+

it("preserves exact allowlisted tool-prefix names in Ollama responses", () => {

873+

const response = {

874+

model: "qwen3:32b",

875+

created_at: "2026-01-01T00:00:00Z",

876+

message: {

877+

role: "assistant" as const,

878+

content: "",

879+

tool_calls: [

880+

{ function: { name: "tool_a", arguments: { value: 1 } } },

881+

{ function: { name: "tools_invoke_test", arguments: { value: 2 } } },

882+

{ function: { name: "function-run", arguments: { value: 3 } } },

883+

],

884+

},

885+

done: true,

886+

};

887+

const result = buildAssistantMessage(response, modelInfo, undefined, {

888+

availableToolNames: new Set(["tool_a", "tools_invoke_test", "function-run"]),

889+

});

890+

expect(result.content).toEqual([

891+

expect.objectContaining({ type: "toolCall", name: "tool_a", arguments: { value: 1 } }),

892+

expect.objectContaining({

893+

type: "toolCall",

894+

name: "tools_invoke_test",

895+

arguments: { value: 2 },

896+

}),

897+

expect.objectContaining({

898+

type: "toolCall",

899+

name: "function-run",

900+

arguments: { value: 3 },

901+

}),

902+

]);

903+

});

904+828905

it("keeps non-prefixed Ollama response tool names intact", () => {

829906

const response = {

830907

model: "qwen3:32b",

@@ -836,6 +913,7 @@ describe("buildAssistantMessage", () => {

836913

{ function: { name: "functionshell", arguments: {} } },

837914

{ function: { name: "tooling", arguments: {} } },

838915

{ function: { name: "tools", arguments: {} } },

916+

{ function: { name: "tool_a", arguments: {} } },

839917

],

840918

},

841919

done: true,

@@ -845,6 +923,7 @@ describe("buildAssistantMessage", () => {

845923

expect.objectContaining({ type: "toolCall", name: "functionshell", arguments: {} }),

846924

expect.objectContaining({ type: "toolCall", name: "tooling", arguments: {} }),

847925

expect.objectContaining({ type: "toolCall", name: "tools", arguments: {} }),

926+

expect.objectContaining({ type: "toolCall", name: "tool_a", arguments: {} }),

848927

]);

849928

});

850929