AI_APICallError: Duplicate item found with id fc_... from the provider API.
This occurs when a request payload contains duplicate provider item references (often from prior tool-call history/memory replay).
In this app, repeated tool-driven prompts in the same conversation (for example multiple create_note requests) can surface the issue if stale provider item IDs are replayed.
- Send only the latest
usermessage intoagent.streamText(...)inapp/routes/api-chat.ts, so assistant/tool parts are not re-submitted as fresh input. - If this exact duplicate-item error occurs, clear VoltAgent memory for that conversation once and retry in
app/routes/api-chat.ts. - Persist stable message IDs by setting
id: msg.idon message create inapp/models/thread.server.ts.
The retry-and-clear behavior is a resilience fallback, not the primary strategy. Preferred design is preventing duplicate provider item IDs from entering replayed conversation history.