Commit Graph

7 Commits

Author SHA1 Message Date
Marcelo Mendes
e2ed93f3db fix: deduplicate tool_use IDs and enable sanitization for Anthropic
Anthropic API rejects requests with duplicate tool_use IDs across messages.
This can happen when:
1. Session transcripts have multiple assistant messages with the same tool_use ID
2. IDs contain special characters that weren't being sanitized for Anthropic

Changes:
- Add deduplication logic in repairToolUseResultPairing() to detect and rename
  duplicate tool_use IDs in assistant messages (e.g., call_1 -> call_1_2)
- Update corresponding toolResult IDs to match the remapped tool_use IDs
- Enable sanitizeToolCallIds for Anthropic provider (was only Google/Mistral)
- Add tests for deduplication scenarios

Fixes error: "messages.X.content.Y: tool_use ids must be unique"
2026-01-30 11:53:49 -03:00
Peter Steinberger
9a7160786a refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
Peter Steinberger
6d16a658e5 refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
Peter Steinberger
c379191f80 chore: migrate to oxlint and oxfmt
Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
2026-01-14 15:02:19 +00:00
Peter Steinberger
f5d5661adf fix: guard session tool results 2026-01-12 17:28:46 +00:00
Peter Steinberger
6668805aca fix(agents): enforce single-writer session files 2026-01-11 02:25:45 +00:00
Peter Steinberger
08cc8f2281 refactor(agents): extract transcript repair module 2026-01-10 22:07:25 +00:00