Skip to content

Last command model is selected after exit and resume #38165

Description

@madflow

Description

I have a /commit command configured to use a specific model:

---
description: Create a git commit
model: opencode/deepseek-v4-flash-free
---

My default model is configured as follows:

{
  "$schema": "https://opencode.ai/config.json",
  "model": "openai/gpt-5.6-sol"
}

I start a session using openai/gpt-5.6-sol, then run the /commit command.

After closing the session with /exit and resuming it through /sessions, the session model is incorrectly set to opencode/deepseek-v4-flash-free, which is the model used by the /commit command.

I expect the resumed session to continue using its original model, openai/gpt-5.6-sol.

Steps to Reproduce

  1. Start a session using openai/gpt-5.6-sol.
  2. Run the /commit command.
  3. Close the session using /exit.
  4. Run /sessions and resume the previous session.
  5. Observe that the selected model is opencode/deepseek-v4-flash-free instead of openai/gpt-5.6-sol.

Expected Behavior

The resumed session should use the session's original model: openai/gpt-5.6-sol.

Actual Behavior

The resumed session uses the model assigned to the most recently executed command: opencode/deepseek-v4-flash-free.

Plugins

None

OpenCode Version

1.18.3

Operating System

macOS Tahoe

Terminal

Ghostty

Screenshot or Share Link

None

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions