Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.narrative.io/llms.txt

Use this file to discover all available pages before exploring further.

Surface: GET /agents/runs/{id}, error.type = "AgentLoopConcurrentConversationAppend"

When this error occurs

FinalizeAgentRunActivity writes the run’s produced messages + bumps agent_conversations.version in a single CAS-protected transaction. This error means the CAS failed: between the API’s pre-flight version check at POST .../runs time and the workflow’s finalize, another writer (a concurrent run, or a manual database edit) bumped the version. Only one run at a time can finalize cleanly on a given conversation. The losing run terminates with this error and its messages are not persisted.

How to fix

This is expected behavior under concurrent runs on the same conversation. Treat it as a retryable signal:
  1. GET /agents/conversations/{id}/messages?since={prior_version} to see what landed.
  2. Start a fresh run with the new version as expected_version. Re-post the original prompt or tool outputs.
If you don’t expect concurrency on this conversation, look at the messages stream — the “other” writer’s identity will be in the latest message’s run_id.