-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
[BUG] API Profile switch: same provider/model does not apply changed settings
Problem (one or two sentences)
Switching to an API Profile that uses the same provider/model does not apply updated settings (e.g., reasoning level, headers, baseUrl, service tier). The active client keeps using the previous settings.
Context (who is affected and when)
Any user who edits or selects an API Profile where the provider/model stays the same but non-model settings differ (reasoning features, header overrides, base URLs, service tiers, etc.), via the profile dropdown under chat or the Settings view.
Reproduction steps
- Environment/setup
- Roo Code v3.31.1 (from src/package.json)
- Any provider with configurable non-model settings (e.g., OpenAI, Anthropic, OpenAI-compatible, etc.)
- Create two profiles with same provider/model but different settings. Examples:
- Same model, different reasoning level or thinking budget
- Same model, different baseUrl or headers
- Same model, different service tier or rate limits
- Select Profile A and start a task (or note behavior).
- Switch to Profile B (same model) using the profile dropdown.
- Observe that behavior/headers/tier/reasoning budget do not reflect Profile B’s settings.
Expected result
All settings from the selected API Profile (including non-model ones) immediately replace the active configuration (i.e., new client or parameters applied).
Actual result
Only provider/model changes trigger an API client rebuild; other setting changes are ignored, so old settings remain in effect.
Variations tried (optional)
- Reproduces both from profile dropdown under chat and Settings view.
- Reproduces across providers where non-model options differ.
App Version
3.31.1
API Provider (optional)
Not Applicable / Other
Model Used (optional)
N/A (bug is provider-agnostic as long as provider/model stay the same)
Roo Code Task Links (optional)
N/A
Relevant logs or errors (optional)
N/A
Code Investigation (root cause)
- The active profile path updates state and then conditionally rebuilds the API handler only if provider or modelId changed:
- Activation path: ClineProvider.activateProviderProfile() sets state and calls:
- Rebuild condition checks only provider/model deltas, not other fields:
- See comparison block at [src/core/webview/ClineProvider.ts:1311]
- As a result, changes like baseUrl, headers, service tier, reasoning/tokens, rate limits, etc. aren’t applied unless provider/modelId differ.
Regression note
This surfaced after #9181, which didn’t handle “same model, different settings” when switching profiles.
Suggestion (non-breaking)
- On profile switch from an explicit user action, either:
- Always rebuild the API handler regardless of provider/model equality; or
- Expand the change-detection to include all relevant settings that affect runtime behavior (baseUrl, headers, service tier, rate limits, reasoning fields, etc.).
- Also ensure the task’s apiConfiguration is fully replaced with the selected profile.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status