Skip to content

Sync librechat-admin-panel 9315de9 into feat/lambda-deploy-target - #6

Closed
AndesBot wants to merge 6 commits into
feat/lambda-deploy-targetfrom
sync/2026-10-15
Closed

AndesBot wants to merge 6 commits into
feat/lambda-deploy-targetfrom
sync/2026-10-15

Conversation

@AndesBot

Copy link
Copy Markdown

Upstream range: b37e045ef12b12dd629f571ed3e18a0c1d4bdd65..9315de900548e5ed980d55d41084cc0d35800672 (2 commits; tag: none).

Conflicts: none. Upstream merged cleanly into the deploy branch; no custom changes needed conflict resolution.

Build and tests: pnpm run build was attempted and failed because Vite cannot resolve @radix-ui/react-visually-hidden imported by src/components/CommandMenu.tsx. pnpm run test passed (27 files, 1,215 tests). Dependencies were installed with pnpm install --lockfile=false; the repository lockfile was not changed.

Needs a person: identify and resolve the missing @radix-ui/react-visually-hidden dependency so the production build completes.

danny-avila and others added 6 commits October 5, 2026 07:10
…reChat-AI#150)

Update @librechat/data-schemas (0.0.56 → 0.0.74) and
librechat-data-provider (0.8.509 → 0.8.524), and adapt the panel:

- Audit log: accept and render the new `permission.insights_assigned` /
  `permission.insights_removed` actions (agent target, "View insights"
  subject, grantee row). Previously any such entry failed response
  validation and broke the whole page.
- Roles: add the new `SCHEDULES` permission type (USE, CREATE).
- Interface permissions: mirror upstream `RUNTIME_CONFIG_INTERFACE_FIELDS`
  so the bare `interface.schedules` runtime toggle is saved instead of
  being silently dropped, while its `use`/`create` sub-keys stay blocked.
- Langfuse: drop the forward-compat schema shim now that the pinned
  data-provider ships the `langfuse` group.
- Config: add section meta for `filters`, `permissions`, and `openapi`,
  plus locale keys for ~190 new schema fields and the new
  `read:insights` / `manage:code_environments` capabilities.
- Tests: add sample overrides for new fields with stricter validation.
* 🚑 fix: Stop Configuration Page Data Loss (Wave 0 Hotfix)

Implements HF-1 to HF-11 of the configuration-page plan, plus HF-12 as
limited by the product decisions (no data-provider bump; unknown keys per D8).

- HF-1 Enter key: every click-ui Button/IconButton now sets an explicit
  htmlType (new ESLint rule click-ui/require-button-html-type); the tab form
  gets a disabled hidden default submit button and blocks implicit submission
  from inputs. Enter can no longer delete an endpoint/social login or add "".
- HF-2 Delete buttons: TrashButton/EditButton are native buttons named
  "Delete <item>"/"Edit <item>"; an entry card ignores keydown from nested
  controls, so Enter on a card's trash button deletes instead of toggling.
- HF-3 Blank values: buildSavePayload normalizes every value (blank list items
  dropped, emptied lists/records become "no value"), drops edits equal to the
  saved value, and turns an emptied override into a reset. Blank allowlist
  rows, empty header lists and stray [] / {} are never written.
- HF-4 beforeunload: only prompts while there are unsaved edits.
- HF-5 YAML import: validates a copy (version optional) but imports the raw
  YAML (no Zod defaults, unknown keys kept and listed), merges through the
  normal validated save path into the target picked in the dialog (base or a
  profile; the open profile is preselected). The full-replace PUT is gone.
- HF-6 Dotted / $ keys: inline errors in key/value rows, record add-key and
  rename inputs; the review blocks the save and names each key; import and the
  server pre-flight reject them (BLOCK_UNSAFE_CONFIG_KEYS flag for BE-1).
- HF-7 Atomic saves: validateConfigChangesFn validates every save (indexed
  array entries against the element schema, process-backed MCP fields, unsafe
  keys, capabilities) before any reset is written; queries always refetch.
- HF-8 Base-only sections (filters) and YAML-only sections (cloudfront,
  rateLimits, turnstile, verified in LibreChat) render read-only with a banner,
  are stripped from saves, and a backend "No actionable" reply is reported as
  a warning instead of "Changes saved".
- HF-9 Azure groups and Anthropic Vertex are read-only with a banner, group
  API keys are masked (also in the review dialog), and a stored override gets
  a "Remove stale override" action.
- HF-10 The save error is cleared on open, cancel, discard and every edit.
- HF-11 Scope mode reads collections from the merged tree when entries have
  pending edits, so sequential edits and "Add item" rows are kept; review
  BEFORE values come from the profile being edited, and the title names it.
- HF-12 (D8) Settings unknown to the bundled schema are listed read-only per
  section and at top level on the System tab; unmapped sections get a
  readable title; test asserts every schema section has SECTION_META.

Saves and imports send at most 100 entries per PATCH (the admin API limit).
Tests: normalizeForSave, findUnsafeKeys, raw YAML import (3 keys -> 3 leaves),
pre-flight checks, import target routing, HF-11 sequential scope edits, secret
masking; Playwright spec for Enter on every tab and delete-button names (axe).

* 🩹 fix: Harden Hotfix Edge Cases (Error IDs, Enter Guard Docs)

- Sanitize the aria-describedby ids of key/value and rename errors (entry
  names can contain spaces) and give each add-key input a unique error id.
- Document that the tab form's Enter guard also covers portaled create
  dialogs, so Enter commits the field being typed instead of submitting a
  half-filled dialog.

* 🛡️ fix: Close Hotfix Gaps on Every Write Path (Import, Partial Strips, Reverts)

Write rules now apply to every write path:
- One shared rule, getWriteSkipReason (src/utils/writes.ts), now drives the
  review, the server pre-flight and every write path: import, base saves,
  bulk profile saves and saveFieldProfileValueFn. Imports can no longer
  store Azure groups (plaintext keys) or Anthropic Vertex overrides. A save
  at an ancestor path that carries one of these fields is rejected. Removing
  a stale override is still allowed.
- Langfuse (BASE_PRINCIPAL_CONFIG_SECTIONS) is skipped on generic writes as
  `dedicated`. mcpAppSandbox is an interim base-only section until the
  data-provider bump.
- A PATCH reply whose stored overrides lack a section that was sent is
  reported as `notStored`, so partial strips are no longer called saved.
- When a later batch fails, the error says how many entries were already
  saved.

Import:
- Import leaves are normalized like edits (normalizeForSave), so
  `allowedDomains: [""]` and blank or null values are reported as `empty`
  instead of being stored.
- AppService alias sections are merged leaf by leaf with their canonical
  section, using APP_SERVICE_KEY_ALIASES, which is shared with
  normalizeAppServiceKeys.
- A numeric `version` no longer fails validation.

Review and messages:
- Emptying a value that only librechat.yaml or the defaults set is now
  reported as `yamlValue` ("can't be cleared here") instead of "nothing
  to save".
- Resets show the stored override as BEFORE and the value the field falls
  back to as REVERTS TO. This uses librechat.yaml for base (the new
  yamlConfig from getBaseConfigFn) and the base value for a profile.
- Warning toasts have a short title and a wrapped list of paths and
  reasons. When nothing was written they say "Nothing was stored", and the
  import success banner is not shown.

Keyboard:
- The tab form's Enter guard only applies to inputs in its own DOM, so the
  portaled Create MCP server and Create endpoint dialogs submit on Enter
  again. Covered by a new e2e test.

Cleanup:
- Removed the dead normalizeImportConfig.
- ConfigRecord and PatchFieldsResponse moved to src/types.
- Write helpers are typed with t.SaveEntry instead of unknown.
- ImportTarget is renamed to WriteTarget.
- Server utils are imported through the @/utils barrel.
- Fixed the prettier issues this branch introduced.

* 🩹 fix: Preserve Whitespace in Saved String Values

normalizeForSave trimmed every string and list item, so saving any sibling
field silently rewrote whitespace-significant values such as stop sequences
("\n\nHuman:" -> "Human:", ["\n"] dropped). Only drop exactly-empty
strings and list items; keep everything else verbatim.

Copy link
Copy Markdown
Author

Superseded by #7

@AndesBot AndesBot closed this Oct 19, 2026
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.

3 participants