Commit Graph

2 Commits

Author SHA1 Message Date
hotwa
2451c35f9d feat: add bidirectional tool_calls normalization
- Add request-normalizer.ts to fix malformed tool_calls from clients
  - Ensure 'id' field exists (auto-generate if missing)
  - Ensure 'type: "function"' field exists
  - Convert 'arguments' string to object (Ollama expects object, not string)

- Update response-rewriter.ts for Ollama native tool_calls
  - Add missing 'type' field to tool_calls
  - Remove Ollama-specific 'function.index' field

- Fix types/ollama.ts: arguments should be object, not string

This enables multi-turn conversations with tool_calls history from OpenClaw
to work correctly with Ollama API.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 14:00:59 +08:00
lingyuzeng
ba7d42da13 first commit 2026-03-22 13:16:22 +08:00