fix(dashboard): clear the model mirror when its custom endpoint is deleted - #67797
Closed
Frowtek wants to merge 1 commit into
Closed
fix(dashboard): clear the model mirror when its custom endpoint is deleted#67797Frowtek wants to merge 1 commit into
Frowtek wants to merge 1 commit into
Conversation
…leted
activate_custom_endpoint copies the endpoint's base_url and api_key onto
cfg["model"]. delete_custom_endpoint pops the providers entry and saves —
it never touches that mirror.
So deleting the endpoint the agent is currently using leaves both behind:
DELETE /api/providers/custom-endpoints/acme -> 200
providers entry gone : True
model.api_key : sk-CUSTOM-ENDPOINT-SECRET
model.base_url : https://llm.acme.corp/v1
Two consequences, both silent:
* The agent keeps authenticating to the deleted host with the deleted key.
model.api_key outranks the environment at client construction, so this
also shadows whatever the operator configures next — the persistent-401
shape credential_lifecycle.py documents as NousResearch#62269.
* A credential the operator just removed through the dashboard stays
sitting in config.yaml.
Scrub the main-slot mirror on delete, but only when it actually names the
deleted provider — an endpoint deleted while a different one is active must
leave that active assignment untouched. Both directions are pinned by tests.
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?
activate_custom_endpointcopies the endpoint'sbase_urlandapi_keyontocfg["model"].delete_custom_endpointpops theprovidersentry and saves — itnever touches that mirror.
So deleting the endpoint the agent is currently using leaves both behind:
Two consequences, both silent:
model.api_keyoutranks the environment at client construction, so it alsoshadows whatever the operator configures next — the persistent-401 shape
credential_lifecycle.pydocuments as [Bug]: "API key updated in UI but old key persists in config.yaml, causing authentication failures" #62269.config.yaml.Introduced with the custom-endpoint settings feature (#67759).
Related Issue
Fixes #
Type of Change
Changes Made
hermes_cli/web_server.py—_detach_main_model_from_provider()scrubs themain-slot
provider/base_url/api_keyon delete, only whenmodelactually names the deleted provider. An endpoint deleted while a different one
is active leaves that active assignment untouched.
tests/hermes_cli/test_web_server.py— both directions.Testing
test_deleting_the_active_custom_endpoint_clears_its_model_mirrorfails onmain, showing the stale mirror verbatim:test_deleting_an_inactive_custom_endpoint_leaves_the_active_one_alonepasses bothways — that's what shows the scrub is targeted, not a blanket wipe.
Web-server / model-switch / config / credential-lifecycle / dashboard-auth suites
baseline-compared against a clean
origin/mainworktree: identical 16 pre-existingfailures,
660 → 662passed.Checklist
mainand covered by a failing-before/passing-after testorigin/main)