Skip to content

Persistent invalid reasoning value ("low") overrides env and CLI settings #9969

@xuxiaoyang-if

Description

@xuxiaoyang-if

Description

Bug Description

When running opencode with gpt-5.2-chat-latest, the CLI fails with:
Error: Unsupported value: ‘low’ is not supported with the ‘gpt-5.2-chat-latest’ model.
Supported values are: ‘medium’.

This occurs even when:

  • OPENCODE_REASONING=medium is exported
  • No agent config sets low
  • Binary is reinstalled
  • Issue reproduces in both CLI and VS Code

Root Cause (Identified)

The invalid reasoning value (low) was persisted in local state directories:
~/.local/share/opencode
~/.config/opencode

Removing these directories resolves the issue immediately:

rm -rf ~/.local/share/opencode
rm -rf ~/.config/opencode

Expected Behavior
	•	Invalid or unsupported reasoning values should not silently persist
	•	Cached state should not override environment variables or CLI defaults
	•	A warning or validation should occur when loading incompatible state

Environment
	•	OS: macOS (Apple Silicon)
	•	Shell: zsh
	•	opencode version: 1.1.30
	•	Install method: curl installer

### Plugins

_No response_

### OpenCode version

1.1.30

### Steps to reproduce

_No response_

### Screenshot and/or share link

_No response_

### Operating System

macOS 26.2

### Terminal

kitty

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions