Skip to content

fix(providers): apply live config reload to Anthropic - #106

Closed
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/high-severity-issues-f5cd
Closed

cursor[bot] wants to merge 1 commit into
mainfrom
cursor/high-severity-issues-f5cd

Conversation

@cursor

@cursor cursor Bot commented Sep 30, 2026

Copy link
Copy Markdown

Bug and impact

After PUT /api/config or SIGHUP, the dashboard and OpenAI/local providers pick up the new model and max_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/config shows the new values, so the mismatch is silent.

Root cause

try_config_reload calls provider_openai_set_live_config and provider_local_set_live_config but never updates s_anth_cfg. build_and_send reads config_agent_model and config_agent_max_tokens from 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 from try_config_reload.

Validation

tests/test_reload.c initializes Anthropic against model-before / 111 tokens, rewrites the config file to model-after / 222, and asserts the live Anthropic config follows the reload. The assertion failed before the reload call was added. make test_reload and make test_anthropic pass.

Tracked ShellClaw fixes still awaiting review: #102, #103, #104, #105.

Open in Web聽View Automation聽

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>
@adriannoes

Copy link
Copy Markdown
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.

@adriannoes adriannoes closed this Oct 16, 2026
@adriannoes
adriannoes deleted the cursor/high-severity-issues-f5cd branch October 16, 2026 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants