Skip to content

New session spawned from keyboard shortcut inherits current mode instead of respecting default_agent #29594

@pt-james-woszczynski

Description

@pt-james-woszczynski

Description

When starting a new session from an existing session using a keyboard shortcut (e.g. while in build mode), the new session opens in build mode rather than respecting the default_agent config setting.

Expected behaviour

A new session should always open using the agent specified in default_agent. In my case, "default_agent": "plan" is set in ~/.config/opencode/opencode.json, so new sessions should open in plan mode regardless of the current session's mode.

Actual behaviour

The new session inherits the mode of the session it was spawned from. If the current session is in build mode, the new session also opens in build mode.

Config

{
  "default_agent": "plan"
}

Environment

  • OpenCode version: 1.14.31
  • OS: macOS (darwin)
  • Terminal: TUI

Steps to reproduce

  1. Set "default_agent": "plan" in config
  2. Open OpenCode (starts correctly in plan mode)
  3. Switch to build mode with Tab
  4. Start a new session via keyboard shortcut
  5. Observe the new session opens in build mode instead of plan mode

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions