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
- Set
"default_agent": "plan" in config
- Open OpenCode (starts correctly in plan mode)
- Switch to build mode with Tab
- Start a new session via keyboard shortcut
- Observe the new session opens in build mode instead of plan mode
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_agentconfig 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
Steps to reproduce
"default_agent": "plan"in config