Skip to content

[upstream #15911] Give artifact edits a revision instead of content-matching the original #211

Open

Description

@berry-13

Artifact edits use the replaced text as their only concurrency check: POST /api/messages/artifact/:messageId accepts { index, original, updated } and refuses the save when original is no longer in the artifact. The client therefore has to decide from content alone whether the registry is lagging behind its own save or was changed elsewhere.

LibreChat-AI#15911 records each save in a per-artifact ledger (EditorContext savedContent) and treats only values the registry has not yet passed as lag. One case stays ambiguous by construction: another writer restoring exactly the pre-save value before the registry has shown this tab's save. The tab then rebases on its own save, and the next edit is refused (400) until the registry changes again. Nothing is lost, but the user sees a refusal.

A revision (or updatedAt) on the artifact, returned by the edit endpoint and carried on the message, would let the client compare revisions instead of text and let the server refuse on revision mismatch.

Source: local review finding local:23c2240:L-001 on LibreChat-AI#15911.

Activity

  1. added
    enhancementNew feature or request
    area: clientreviewctl followups state
    area: apireviewctl followups state
    readyreviewctl followups state
    and removed on Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: apireviewctl followups statearea: clientreviewctl followups stateenhancementNew feature or requestreadyreviewctl followups state

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions