Feat/export yaml#88
Conversation
Adds an Export YAML button next to the existing Import YAML button in the configuration header. Clicking it downloads the current configured overrides (or full config if no overrides exist) as librechat.yaml using js-yaml on the client side — no server roundtrip needed.
- Append anchor to document.body before click and remove after (Firefox requires element in DOM to trigger file download) - Defer URL.revokeObjectURL with setTimeout to avoid revocation before browser reads the blob - Disable export button while config data is still loading
|
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
Reviewed by Cursor Bugbot for commit afe5b1d. Configure here.
| a.click(); | ||
| document.body.removeChild(a); | ||
| setTimeout(() => URL.revokeObjectURL(url), 100); | ||
| }, [dbOverrides, configValues]); |
There was a problem hiding this comment.
Scope mode exports base config
High Severity
handleExport always serializes base dbOverrides or configValues, even when a role or group scope is selected. The UI and import path use scope-specific profile data in that mode, so the downloaded librechat.yaml can be the global admin config instead of the scope overrides shown on the page.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit afe5b1d. Configure here.
| a.click(); | ||
| document.body.removeChild(a); | ||
| setTimeout(() => URL.revokeObjectURL(url), 100); | ||
| }, [dbOverrides, configValues]); |
There was a problem hiding this comment.
Export ignores unsaved edits
Medium Severity
Export stays enabled when the form is dirty and writes only persisted dbOverrides or configValues, not in-memory editedValues. Import and reset are disabled while dirty, so a user can download YAML that omits pending changes they still see in the UI.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit afe5b1d. Configure here.


Summary
Adds an Export YAML button to the configuration page header, next to the existing Import YAML button. Clicking it downloads the current configured overrides (falling back to the full resolved config if no overrides exist) as
librechat.yaml— entirely client-side usingjs-yaml(already a dependency), with no extra server roundtrip.Fixes applied after review:
document.bodybefore.click()and removed after — Firefox requires the element to be in the DOM to trigger a file downloadURL.revokeObjectURLdeferred withsetTimeoutso the browser reads the blob before it is revokedcom_config_export_yamli18n keyChange Type
Testing
bun run dev)librechat.yamlfile should download containing the current configuration overridesTest Configuration:
Checklist