Skip to content

[BUG] Agent mode switch resets thinking level to default #17469

@bugulo

Description

@bugulo

Description

Switching agent modes (Build / Plan / Docs) resets the thinking variant to default. For example, selecting "Max thinking" then switching from Build to Plan reverts thinking to the default level.

Reproduced in the desktop app (v1.2.26). agent.set() in packages/app/src/context/local.tsx overwrites the entire per-session state with the new agent's defaults instead of merging. Since most agents don't configure a model or variant, the user's selection is replaced with undefined.

OpenCode version

1.2.26

Steps to reproduce

  1. Select a model with thinking variants (e.g. Claude Sonnet)
  2. Set thinking level to "Max thinking"
  3. Switch agent mode from Build to Plan
  4. Thinking level resets to default

Operating System

Windows 11

Metadata

Metadata

Assignees

Labels

webRelates to opencode on web / desktopwindows

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions