Skip to content

bug: task-level Cline model picker can initialize or persist the wrong model #469

Description

@oshea-patrick

Bug Description

When task-level Cline settings partially override the workspace defaults, the task detail model picker can initialize or persist the wrong model. This manifests as:

  • A task showing one model in the picker but launching with another
  • A model change from one task bleeding into another task

Environment

  • OS: Linux (reproducible on all platforms — this is a web-ui React bug)
  • Agent: Cline (any version using the Kanban web UI)

Steps to Reproduce

  1. Configure a global Cline provider/model (e.g. Anthropic with claude-sonnet-4.6).
  2. Open or create a task that either:
    • has only providerId overridden at task level (no explicit modelId), or
    • is still inheriting workspace Cline settings — then change the model from the task detail/chat panel picker.
  3. Switch between multiple tasks with different providers/models, or start them in parallel.

Expected Behavior

  • A provider-only task override should use that provider's default model.
  • Changing the model from an existing task's chat panel should create or update task-specific Cline settings, not global settings.
  • Multiple tasks should retain their own provider/model selections independently.

Actual Behavior

  • The task can initialize from the global model instead of the overridden provider's default.
  • The task detail/chat picker can update global Cline settings instead of the current task.
  • This makes it look like a task is using a model from another task or from the last task you touched.

Root Cause

Two issues in the web-ui:

  1. getInitialTaskModelId fell through to the global effective provider model when a task had only a providerId override.
  2. ClineAgentChatPanel.persistClineModelSettings only wrote task-level overrides when taskHasExplicitClineSettings was already true, falling back to global settings for inherited tasks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions