Summary
When starting a new session from inside an existing OpenCode TUI session, the new session does not start blank. It appears to inherit the prompt/message from the session it was opened from, then treats that inherited text as the first user message in the new session.
This is surprising because /new is documented as starting a new session, and a new session should open with an empty prompt/history.
Environment
- OpenCode version: 1.14.31
- OS: macOS 26.5.1
- Interface: TUI
Expected Behavior
Starting a new session with /new or the new-session keybind should create a blank session with no inherited user prompt or submitted message.
If default_agent is configured as plan, the new blank session should start in Plan mode.
Actual Behavior
The newly created session starts with text inherited from the session where it was opened. That inherited text becomes the first user message in the new session, so the assistant immediately responds to it instead of waiting for a fresh prompt.
Relevant Config Checks
Local checks suggest this is not caused by user config:
default_agent is set to plan.
- No project-level OpenCode config is overriding the global config.
- No custom TUI keybind config is overriding the new-session keybind.
- The only custom plugin present affects image attachment resizing and does not touch sessions or prompt state.
Reproduction Steps
- Open OpenCode TUI.
- Start or resume a session.
- Use
/new or the configured new-session keybind.
- Observe the newly created session.
Result
The new session contains the inherited prompt/message from the previous session instead of starting blank.
Expected Result
The new session should start blank, with an empty input area and no copied/submitted user message from the previous session.
Privacy Note
This report intentionally omits local project paths, provider details, model configuration, prompt content, and workspace-specific information.
Summary
When starting a new session from inside an existing OpenCode TUI session, the new session does not start blank. It appears to inherit the prompt/message from the session it was opened from, then treats that inherited text as the first user message in the new session.
This is surprising because
/newis documented as starting a new session, and a new session should open with an empty prompt/history.Environment
Expected Behavior
Starting a new session with
/newor the new-session keybind should create a blank session with no inherited user prompt or submitted message.If
default_agentis configured asplan, the new blank session should start in Plan mode.Actual Behavior
The newly created session starts with text inherited from the session where it was opened. That inherited text becomes the first user message in the new session, so the assistant immediately responds to it instead of waiting for a fresh prompt.
Relevant Config Checks
Local checks suggest this is not caused by user config:
default_agentis set toplan.Reproduction Steps
/newor the configured new-session keybind.Result
The new session contains the inherited prompt/message from the previous session instead of starting blank.
Expected Result
The new session should start blank, with an empty input area and no copied/submitted user message from the previous session.
Privacy Note
This report intentionally omits local project paths, provider details, model configuration, prompt content, and workspace-specific information.