Skip to content

[BUG] API Profile switch: same provider/model does not apply changed settings #9208

@hannesrudolph

Description

@hannesrudolph

[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

  1. 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.)
  2. 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
  3. Select Profile A and start a task (or note behavior).
  4. Switch to Profile B (same model) using the profile dropdown.
  5. 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:

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

No one assigned

    Labels

    Issue - In ProgressSomeone is actively working on this. Should link to a PR soon.bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions