fix(gateway): dashboard config save applies JSON and reloads live settings - #58
Draft
cursor[bot] wants to merge 1 commit into
Draft
fix(gateway): dashboard config save applies JSON and reloads live settings#58cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
PUT /api/config accepted raw TOML while the web UI sends JSON, so saves either failed validation or never updated in-memory provider settings. Patch known dashboard fields into config.toml and call try_config_reload after a successful write. Co-authored-by: esadrianno <esadrianno@gmail.com>
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.
Bug and impact
The gateway dashboard Config page sends JSON (
model,max_tokens,temperature, etc.) viaPUT /api/config, but the handler wrote the body directly toconfig.tomland validated it as TOML. Saves either failed with400 Invalid TOMLor, if raw TOML was posted manually, never updated in-memory provider/router settings untilSIGHUP/restart.User impact: Operators believe settings were saved (UI shows "Saved") while the agent continues using stale model/temperature — significant configuration breakage.
Root cause
web/js/app.js(JSON) andhandle_config_put(raw TOML).try_config_reload()after successful disk write.Fix
config.tomlin-place for dashboard fields (config_patch_dashboard_json).try_config_reload()after a successful save so live providers/gateway pick up changes immediately.Validation
build/test_config_patch— unit tests for JSON patching and validation.build/test_gateway_http— integration testtest_api_config_put_jsonverifies PUT + GET returns updated model/max_tokens.