feat: reload declarative config without process restart - #565
Open
shashankrawlani wants to merge 1 commit into
Open
feat: reload declarative config without process restart#565shashankrawlani wants to merge 1 commit into
shashankrawlani wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a file-system watcher that re-applies a valid
FREEAPI_CONFIG_PATHJSONatomically, without stopping or restarting the FreeLLMAPI process. The last
known-good configuration is kept when a replacement is invalid or temporarily
unavailable.
Providers and deployment controllers (Infisical, Vault, AWS Secrets Manager,
Kubernetes Secrets, GitOps reconcilers) only need to write a temporary file and
mvit over the configured path — they are not coupled to FreeLLMAPI.Why
Previously the config was loaded once at startup and never updated without a
restart. Operators using secret managers for provider keys had no safe way to
rotate them without downtime or manual steps.
How
server/src/services/declarative-config-reloader.ts: generic, provider-agnosticfile watcher. Handles overlapping reloads (debounce + queue), invalid JSON, and
missing files gracefully.
server/src/index.ts: activates the watcher whenFREEAPI_CONFIG_PATHis set,falls back to the one-shot behaviour otherwise.
README.mdanddocker/README.mdnow document the watcher.declarative-config-reloader.test.tscovers atomic replacement anderror-resilience.
Tests
Full suite: 1,045 / 1,045 passing (103 test files).
Checklist