Commit Graph
1 Commits
Author SHA1 Message Date
yetone 40ece3a0d1 gui: a provider's Save keeps the tag, website and key page set from the CLI or TUI, and on a preset's provider its Balance and Models URLs, which the editor doesn't show
Found while tracing 01huadalang's report (Discord, a Responses pick reopening
as OpenAI compatible): POST /api/provider/save replaces the whole provider
with what the editor sent, and the editor never sends family, website or
keysUrl (nor balance, balancePath and modelsUrl for a preset's provider,
whose editor has no field for them). So `magpie provider set x family=…`
or the TUI's "f" was undone by the next Save in the GUI. A field the
request leaves empty now keeps its saved value.

Verified: TestProviderSaveKeepsWhatTheEditorDoesntShow (preset and custom
cases) fails without the providers.go change and passes with it. In a
sandbox HOME with the built binary: `provider set relay-a family=relays
website=… keys=…`, then renamed and saved Relay A in the real GUI;
providers.json kept all three and baseAPI "responses".
2026-10-07 06:14:20 +08:00