{"version":"2.1.269","anchor":"new-version-required-reason-added-to-optimistic-concurrenc","canonical_anchor":"new-guided-error-messages-when-a-structured-db-write-omits-a","heading":"Clearer errors when a database write skips a required version check","tier":"notice","area":"Database Tools","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.269\/e\/new-version-required-reason-added-to-optimistic-concurrenc","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.269","markdown":"### Clearer errors when a database write skips a required version check\n\nDatabase write, delete, and batch-write tools now give specific guidance when a required if_version was left out, backed by a version_required error code\n\n**What**\n\n- Document\/database write and delete tools now give a dedicated error message when a change to an existing document was missing a required `if_version`, distinguishing delete, update, and create\/default cases with wording like \"this delete carried no if_version \u2014 nothing was deleted\".\n\n- The batch-write tool gives the same kind of message, naming the exact write's index and path, and warns that other unpinned writes in the same batch will fail the same way.\n\n- All these messages tell the model to `read_db` (or read the document) first, then resend the write with `if_version` set.\n\n- A new `version_required` reason (with a `required: true` field) is now returned separately from the generic `version_mismatch` reason, backed by a structured error-detail schema (code, kind, limit, version, index, required).\n\n**Why** This makes \"optimistic concurrency\" failures (where a document changed since you last read it) much easier to recover from: instead of a generic version-mismatch error, Claude Code now gets a precise explanation of what went wrong and how to fix it, reducing wasted retries on database writes.\n\n- Area: Database Tools\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 1\/5"}