Repository navigation
fix(providers): apply live config reload to Anthropic - #106
Closed
cursor[bot] wants to merge 1 commit into
Closed
cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
Dashboard and SIGHUP reloads updated OpenAI and the local provider but left Anthropic on the config captured at init. The default provider then kept sending the previous model and max_tokens. Co-authored-by: esadrianno <esadrianno@gmail.com>
Collaborator
|
Superseded by #124: consolidated into the operator-authored branch fix/providers-anthropic-local (same fixes, re-validated with make test_reload, make test_anthropic, make test_local_provider, CI=true make test, make static). Closing in favor of the consolidation. |
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
After
PUT /api/configor SIGHUP, the dashboard and OpenAI/local providers pick up the newmodelandmax_tokens, but Anthropic keeps the config captured at process start. Anthropic is the default provider, so every later chat still sends the old model and token cap.GET /api/configshows the new values, so the mismatch is silent.Root cause
try_config_reloadcallsprovider_openai_set_live_configandprovider_local_set_live_configbut never updatess_anth_cfg.build_and_sendreadsconfig_agent_modelandconfig_agent_max_tokensfrom that pointer on every request.Fix
Add
provider_anthropic_set_live_config(same shape as the OpenAI setter: swap the pointer only after a successful init) and call it fromtry_config_reload.Validation
tests/test_reload.cinitializes Anthropic againstmodel-before/ 111 tokens, rewrites the config file tomodel-after/ 222, and asserts the live Anthropic config follows the reload. The assertion failed before the reload call was added.make test_reloadandmake test_anthropicpass.Tracked ShellClaw fixes still awaiting review: #102, #103, #104, #105.