LibreChat/config
Atef Bellaaj d481b6b695
🏬 feat: Sync Langfuse Prompts into the Catalog (#17095)
* feat(prompts): sync Langfuse prompts into the catalog

* refactor(prompts): compose the Langfuse prompt sync runner outside the admin handler

Add createLangfusePromptSyncRunner, which binds the lock, the prompt-group
methods, the ACL grant and the Mongo error predicates once and returns a
runner that takes the per-request source, connection-bound listPrompts,
lock lease and page cap. The admin handler receives that runner as one
dependency instead of forwarding its parts, and its config method
signatures return a LangfuseAdminConfig interface in place of Mongoose
document types.

In api, api/cache/distributedLock.js creates the one DistributedLock for
the process and api/server/services/LangfusePromptSync.js composes the
runner once with it; the admin route imports the composed runner.

* fix(prompts): report incomplete Langfuse syncs and gate the sync action

- Refresh the prompt-group and effective-permission queries after a failed
  sync too, because earlier imports can already be committed.
- Return `complete: false` when the page limit stops a sync before the last
  upstream page, and show a warning instead of the success message.
- Show the Sync prompts action only to users with `manage:prompts`, the
  capability the sync route requires. Resolve the Langfuse startup-config
  capabilities in one batched lookup.
- Document that an interrupted import can leave a group without its initial
  PUBLIC grant, and that a page in progress can outlast an expired lease.

---------

Co-authored-by: Rebase Probe <probe@example.com>
2026-10-24 13:48:52 +02:00
..
__tests__ 🏬 feat: Sync Langfuse Prompts into the Catalog (#17095) 2026-10-24 13:48:52 +02:00
add-balance.js
ban-user.js
circular-deps.mjs 📦 feat: Scaffold the @librechat/chat Package (#16964) 2026-10-10 21:00:10 +02:00
connect.js
create-error-convo.js 📡 fix: Explain Model Streams That Die Mid-Response (#16415) 2026-09-27 15:21:20 -04:00
create-user.js 💬 refactor: ChatForm UI redesign with unified palette (#14473) 2026-10-01 03:46:18 +00:00
delete-banner.js
delete-user.js 🗑️ fix: Route Delete-User CLI Through the Shared Account Erasure Cascade (#17033) 2026-10-14 23:53:16 +02:00
deployed-update.js 🚚 chore: Point Repository and Image References at LibreChat-AI (#16005) 2026-09-23 23:08:36 -04:00
flush-cache.js
helpers.js 🔒 fix: Hide Password Input in Reset CLI (#14923) 2026-08-18 07:50:47 -04:00
invite-user.js 🖍️ refactor: Typed Console Colors and Hardened Script Helpers (#14778) 2026-08-12 22:48:36 -04:00
jest.config.js 🔗 feat: Add Granular Access Control to Shared Links via ACL System (#13051) 2026-06-03 14:17:17 -04:00
jest.setup.logging.cjs 🔇 refactor: Quiet Framework Logging in Unit Tests (#15363) 2026-08-30 15:26:30 -04:00
jest.workers.cjs 🧠 perf: Recycle Backend Jest Workers Past 1GB (#17098) 2026-10-16 22:15:10 +02:00
list-balances.js 🗄️ perf: Cut Serial and Redundant Database Reads (#16711) 2026-10-03 10:41:47 -04:00
list-users.js 📃 fix: Enforce Terms Acceptance on the Server and Mark Backfilled Consent (#17063) 2026-10-14 17:45:28 +02:00
migrate-agent-permissions.js
migrate-code-file-duplicates.js 🧹 chore: Migrate Legacy Duplicate Code Files Blocking Dedupe Index (#14593) 2026-08-02 06:41:21 -04:00
migrate-orphaned-agent-files.js
migrate-prompt-permissions.js 🏬 feat: Sync Langfuse Prompts into the Catalog (#17095) 2026-10-24 13:48:52 +02:00
migrate-search-tokens.js 🔎 perf: Index-Bound Word-Prefix Search for Users and Groups (#16719) 2026-10-16 22:41:37 +02:00
migrate-shared-link-permissions.js 🔗 feat: Add Granular Access Control to Shared Links via ACL System (#13051) 2026-06-03 14:17:17 -04:00
migrate-tenant-indexes.js 🛗 fix: Add Tenant Index Upgrade Migration (#15767) 2026-09-09 00:10:40 -04:00
migrate-terms-timestamp.js 📃 fix: Enforce Terms Acceptance on the Server and Mark Backfilled Consent (#17063) 2026-10-14 17:45:28 +02:00
packages.js 📦 feat: Scaffold the @librechat/chat Package (#16964) 2026-10-10 21:00:10 +02:00
reset-meili-sync.js
reset-password.js 🔐 feat: Enforce Required Two-Factor Authentication (#14731) 2026-10-01 23:39:51 +02:00
reset-terms.js 📃 fix: Enforce Terms Acceptance on the Server and Mark Backfilled Consent (#17063) 2026-10-14 17:45:28 +02:00
set-balance.js 🏦 fix: Reserve Credits for In-Flight Requests (#15879) 2026-09-13 12:53:19 -04:00
smart-reinstall.js
stop-backend.js
test-subdirectory-setup.sh
update-banner.js
update.js 🖍️ refactor: Typed Console Colors and Hardened Script Helpers (#14778) 2026-08-12 22:48:36 -04:00
user-stats.js 🗄️ perf: Cut Serial and Redundant Database Reads (#16711) 2026-10-03 10:41:47 -04:00