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

推荐订阅源

博客园 - 聂微东
GbyAI
GbyAI
S
SegmentFault 最新的问题
H
Hackread – Cybersecurity News, Data Breaches, AI and More
V
Visual Studio Blog
WordPress大学
WordPress大学
Hugging Face - Blog
Hugging Face - Blog
B
Blog
宝玉的分享
宝玉的分享
Last Week in AI
Last Week in AI
雷峰网
雷峰网
爱范儿
爱范儿
Vercel News
Vercel News
人人都是产品经理
人人都是产品经理
U
Unit 42
Microsoft Azure Blog
Microsoft Azure Blog
Microsoft Security Blog
Microsoft Security Blog
Jina AI
Jina AI
P
Proofpoint News Feed
A
About on SuperTechFans
I
InfoQ
F
Fortinet All Blogs
L
LangChain Blog
T
Tailwind CSS 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
fix: parse Ollama tool call arguments · openclaw/openclaw...
steipete · 2026-04-27 · via Recent Commits to openclaw:main

@@ -606,6 +606,73 @@ describe("buildAssistantMessage", () => {

606606

expect(toolCall.id).toMatch(/^ollama_call_[0-9a-f-]{36}$/);

607607

});

608608609+

it("parses stringified tool call arguments from Ollama responses", () => {

610+

const response = {

611+

model: "qwen3:32b",

612+

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

613+

message: {

614+

role: "assistant" as const,

615+

content: "",

616+

tool_calls: [{ function: { name: "bash", arguments: '{"command":"ls","path":"/tmp"}' } }],

617+

},

618+

done: true,

619+

};

620+

const result = buildAssistantMessage(response, modelInfo);

621+

expect(result.content[0]).toMatchObject({

622+

type: "toolCall",

623+

name: "bash",

624+

arguments: { command: "ls", path: "/tmp" },

625+

});

626+

});

627+628+

it("preserves unsafe integers in stringified tool call arguments", () => {

629+

const response = {

630+

model: "qwen3:32b",

631+

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

632+

message: {

633+

role: "assistant" as const,

634+

content: "",

635+

tool_calls: [

636+

{

637+

function: {

638+

name: "send",

639+

arguments: '{"target":9223372036854775807,"nested":{"thread":1234567890123456789}}',

640+

},

641+

},

642+

],

643+

},

644+

done: true,

645+

};

646+

const result = buildAssistantMessage(response, modelInfo);

647+

expect(result.content[0]).toMatchObject({

648+

type: "toolCall",

649+

name: "send",

650+

arguments: {

651+

target: "9223372036854775807",

652+

nested: { thread: "1234567890123456789" },

653+

},

654+

});

655+

});

656+657+

it("falls back to empty arguments for malformed stringified tool call arguments", () => {

658+

const response = {

659+

model: "qwen3:32b",

660+

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

661+

message: {

662+

role: "assistant" as const,

663+

content: "",

664+

tool_calls: [{ function: { name: "bash", arguments: '{"command":"ls"' } }],

665+

},

666+

done: true,

667+

};

668+

const result = buildAssistantMessage(response, modelInfo);

669+

expect(result.content[0]).toMatchObject({

670+

type: "toolCall",

671+

name: "bash",

672+

arguments: {},

673+

});

674+

});

675+609676

it("sets all costs to zero for local models", () => {

610677

const response = {

611678

model: "qwen3:32b",

@@ -701,7 +768,7 @@ describe("parseNdjsonStream", () => {

701768702769

// Simulate the accumulation logic from createOllamaStreamFn

703770

const accumulatedToolCalls: Array<{

704-

function: { name: string; arguments: Record<string, unknown> };

771+

function: { name: string; arguments: unknown };

705772

}> = [];

706773

const chunks = [];

707774

for await (const chunk of parseNdjsonStream(reader)) {