fix(dashboard): don't wipe hand-written provider fields on custom-endpoint edit - #67802
Closed
Frowtek wants to merge 1 commit into
Closed
fix(dashboard): don't wipe hand-written provider fields on custom-endpoint edit#67802Frowtek wants to merge 1 commit into
Frowtek wants to merge 1 commit into
Conversation
…point edit
_write_custom_endpoint builds a fresh entry dict from the request body and
assigns it over providers[endpoint_id], carrying nothing forward but api_key.
A providers.<name> block is not owned by that panel. It can carry keys the
dashboard has no field for, all of them load-bearing:
api_mode the protocol the endpoint speaks
key_env where the credential comes from
extra_headers per-provider HTTP headers (may carry credentials)
request_overrides extra body params
and a models map with more than the one model the panel names.
So an edit that only changes the default model destroys the rest:
BEFORE api_mode, base_url, extra_headers, key_env, model, models,
name, request_overrides
AFTER base_url, discover_models, model, models, name
FIELDS DESTROYED: ['api_mode', 'extra_headers', 'key_env',
'request_overrides']
The provider is left with no credential wiring (key_env gone, no api_key),
talking the wrong protocol, missing its proxy auth header — from a UI action
that said nothing about any of that. The models map also collapses to the one
named model, dropping the others and their context_length.
Merge onto the existing entry instead of replacing it, and merge the models
map rather than overwriting it. Managed fields still win, so the edit itself
still applies; a brand-new endpoint is unchanged. api_key keeps its previous
semantics — a supplied key overwrites, an omitted one leaves the stored key
in place (now via the merge rather than an explicit carry-forward branch).
4 tasks
Contributor
|
Merged via PR #68074 with your commit's authorship preserved in git log (rebase-merge). This PR went conflict-dirty after #67806 landed first — all three dashboard PRs inserted tests at the same anchor in test_web_server.py — so it was cherry-picked onto current main rather than merged directly. Thanks for the whole cluster, these were clean, well-tested fixes. |
This was referenced Jul 20, 2026
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 does this PR do?
_write_custom_endpointbuilds a freshentrydict from the request body andassigns it over
providers[endpoint_id], carrying nothing forward butapi_key.A
providers.<name>block is not owned by that panel. It can carry keys thedashboard has no field for, all of them load-bearing:
api_modekey_envextra_headersconfig.pynotes these "may carry credentials"request_overrides…plus a
modelsmap with more than the one model the panel names.So an edit that only changes the default model destroys the rest:
The provider is left with no credential wiring (
key_envgone and noapi_key), talking the wrong protocol, missing its proxy auth header — from a UIaction that said nothing about any of that. The
modelsmap also collapses to theone named model, dropping the others and their
context_length.Introduced with the custom-endpoint settings feature (#67759).
Related Issue
Fixes #
Type of Change
Changes Made
hermes_cli/web_server.py— merge onto the existing entry instead of replacingit, and merge the
modelsmap rather than overwriting it. Managed fields stillwin, so the edit itself still applies; a brand-new endpoint is unchanged.
api_keykeeps its previous semantics — a supplied key overwrites, an omittedone leaves the stored key in place (now via the merge rather than an explicit
carry-forward branch).
tests/hermes_cli/test_web_server.py— hand-written fields survive an edit; theother models and their context lengths survive.
Testing
Both new tests fail on
main; the feature's own two custom-endpoint testsstill pass, which is what shows the merge didn't change create/assignment
behaviour.
Web-server / model-switch / config / credential-lifecycle suites
baseline-compared against a clean
origin/mainworktree: identical 16pre-existing failures,
627 → 629passed.Checklist
mainand covered by a failing-before/passing-after testorigin/main)