mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-16 13:03:31 +08:00
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.