Skip to content

New session inherits and submits the current session's first prompt instead of starting blank #34069

Description

@pt-james-woszczynski

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

  1. Open OpenCode TUI.
  2. Start or resume a session.
  3. Use /new or the configured new-session keybind.
  4. 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.

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