Skip to content

feat(opencode): add per-agent thinking toggle#27856

Open
salema97 wants to merge 2 commits into
anomalyco:devfrom
salema97:feat/agent-thinking
Open

feat(opencode): add per-agent thinking toggle#27856
salema97 wants to merge 2 commits into
anomalyco:devfrom
salema97:feat/agent-thinking

Conversation

@salema97
Copy link
Copy Markdown

Issue for this PR

Closes #

Type of change

  • New feature

What does this PR do?

Adds a thinking field to agent configuration that allows overriding the model's default thinking/reasoning mode on a per-agent basis.

  • thinking: true — forces thinking on (uses model defaults)
  • thinking: false — forces thinking off (strips all reasoning options from the request)
  • thinking: undefined — uses model default behavior

This is useful for custom agents where you want deterministic, fast responses without reasoning overhead, or conversely where you want to ensure reasoning is enabled regardless of model defaults.

Changes:

  • config/agent.ts: added thinking to schema and KNOWN_KEYS
  • agent/agent.ts: added thinking to Info schema and merge logic
  • session/llm.ts: strips thinking/reasoning options when agent.thinking === false

Example agent config:

---
description: Fast code reviewer
mode: subagent
thinking: false
---
You are a fast code reviewer focused on style and obvious issues...

How did you verify your code works?

  • Verified thinking field is accepted in agent markdown frontmatter
  • Verified thinking: false strips reasoning options before the LLM call
  • Verified thinking: true preserves model default reasoning behavior
  • Verified undefined thinking leaves model defaults unchanged

Screenshots / recordings

N/A — Backend logic change, no UI changes.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

salema97 added 2 commits May 16, 2026 05:20
Adds a new /yolo slash command in TUI sessions that toggles auto-approval
of all permission requests without prompting the user.

Changes:
- TUI session commands: new /yolo slash command in command palette
- KV store: persists yolo_mode state across sessions
- TUI footer: shows 'YOLO' indicator in warning color when active
- TUI sidebar: shows 'YOLO MODE' badge above the version footer
- TUI sync: auto-replies permissions when kv.get('yolo_mode') is true
Adds a  field to agent configuration that allows overriding
the model's default thinking/reasoning mode per agent.

-  — forces thinking on (uses model defaults)
-  — forces thinking off (strips all reasoning options)
-  — uses model default behavior

This is useful for custom agents where you want deterministic,
fast responses without reasoning overhead, or conversely where you
want to ensure reasoning is enabled regardless of model defaults.

Files changed:
- config/agent.ts — added  to schema and KNOWN_KEYS
- agent/agent.ts — added  to Info schema and merge logic
- session/llm.ts — strips thinking options when agent.thinking=false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant