程序员阿江(Relakkes) f9f1f20e99 Fix local proxy tool calls for real provider responses
Local OpenAI-compatible proxies can return function arguments as parsed objects instead of JSON strings. Preserve object-shaped arguments directly and serialize them for streaming deltas so Write, Bash, and Edit tool calls keep the fields required by Anthropic tool validation.

Constraint: Local proxy implementations such as OneAPI/NewAPI may not preserve OpenAI's string-only arguments shape.
Rejected: Normalize every upstream response through JSON.stringify before parsing | loses already-valid object identity and leaves streaming object deltas vulnerable to [object Object].
Confidence: high
Scope-risk: narrow
Directive: Do not assume function.arguments is always a string on provider responses or stream deltas.
Tested: bun test src/server/__tests__/proxy-streaming.test.ts src/server/__tests__/proxy-transform.test.ts
Tested: bun run check:server
Tested: bun run check:native
Tested: bun run quality:pr
Tested: agent-browser with real Ollama qwen3:4b provider for Write/Bash/Edit and streaming Write
Not-tested: Real Windows OneAPI/NewAPI instance from the issue reporters was not available locally.
2026-05-06 11:39:10 +08:00
..
2026-05-04 16:45:24 +08:00
2026-05-04 16:45:24 +08:00
2026-05-04 17:57:03 +08:00
2026-04-18 20:34:56 +08:00
2026-05-04 16:45:24 +08:00
2026-03-31 01:55:58 -07:00
2026-04-18 20:34:56 +08:00
2026-04-18 20:34:56 +08:00
2026-03-31 01:55:58 -07:00
2026-03-31 01:55:58 -07:00
2026-03-31 01:55:58 -07:00
2026-04-03 00:30:56 +08:00
2026-03-31 01:55:58 -07:00
2026-03-31 01:55:58 -07:00
2026-03-31 01:55:58 -07:00
2026-03-31 01:55:58 -07:00
2026-05-04 16:45:24 +08:00
2026-03-31 01:55:58 -07:00
2026-03-31 01:55:58 -07:00
2026-03-31 01:55:58 -07:00