Skip to content

feat(config): add atomic saves and revision rollback - #143

Open
romy651 wants to merge 5 commits into
LibreChat-AI:mainfrom
fdj-united:feat/admin-config-atomic-mutate
Open

feat(config): add atomic saves and revision rollback#143
romy651 wants to merge 5 commits into
LibreChat-AI:mainfrom
fdj-united:feat/admin-config-atomic-mutate

Conversation

@romy651

@romy651 romy651 commented Sep 1, 2026

Copy link
Copy Markdown

Summary

Adds atomic, versioned configuration saves and revision rollback to the LibreChat Admin Panel.

  • Send base saves, resets, imports, logical deletions, activation changes, and restores through LibreChat's atomic mutation endpoint with expectedVersion and expectedTenantId.
  • Freeze the version/content baseline while edits or destructive-action dialogs are open; offer explicit rebase/discard recovery for version conflicts.
  • Reject out-of-order snapshots so stale fetches cannot replace newer configuration content.
  • Read raw configuration snapshots and revision history exclusively through authenticated, tenant-scoped backend APIs. Remove the panel's direct MongoDB code, dependency, credentials, and configuration requirements.
  • Forward the request's tenant header consistently, including token refresh, and fence tenant-scoped reads and writes against stale UI targets.
  • Partition capabilities, grants, audit, users, roles, groups, members, and configuration-profile query keys by effective tenant; remount tenant-derived UI when the authoritative context changes.
  • Correct profile-value invalidation so an open cascade dialog refreshes after a profile mutation.
  • Reconstruct indexed edits as whole-array writes, preserve secret identities and explicit clears, reject unsafe paths and overlapping operations, and drop unsafe container drafts during rebase.
  • Preserve inactive-base behavior and keep Langfuse credentials on the dedicated verified backend path.

Backend dependency: danny-avila/LibreChat#15458

Deployment and compatibility

Deploy the matching backend before, or in the same release train as, this PR. The panel depends on the new atomic and tenant-context API contract.

The panel must not receive MongoDB credentials. MongoDB transactions, revision storage, and rollback are owned by LibreChat. The backend requires a transaction-capable replica set and its documented one-time drain/Recreate upgrade when moving from a pre-version-epoch release.

Change Type

  • Bug fix
  • New feature
  • Breaking change: requires the paired backend API contract
  • Documentation update
  • English translation update

Validation

  • bun run test — 39 test files, 1,078 tests passed.
  • bunx tsc --noEmit — passed.
  • bun run lint — passed.
  • bun run build — passed again before this update; Vite reports browser-externalization and chunk-size warnings.
  • git diff --check — passed.

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes

Romuald Wandji added 3 commits September 1, 2026 12:06
Keep a revision before each save, import, or reset, and add History on the configuration page. Persist to Mongo when MONGO_URI is set so a mistaken change can be rolled back.
Pin mongodb@6 so the Bun server can connect, and default to the LibreChat database when the URI has no path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant