Skip to content

feat(opencode): add /yolo toggle and per-agent thinking control#27851

Closed
salema97 wants to merge 2 commits into
anomalyco:devfrom
salema97:dev
Closed

feat(opencode): add /yolo toggle and per-agent thinking control#27851
salema97 wants to merge 2 commits into
anomalyco:devfrom
salema97:dev

Conversation

@salema97
Copy link
Copy Markdown

@salema97 salema97 commented May 16, 2026

Issue for this PR

Closes #

Type of change

  • New feature

What does this PR do?

This PR adds two independent but complementary features:

1. /yolo toggle command for auto-approving permissions

Adds a new /yolo slash command in the TUI session that toggles auto-approval of all permission requests without prompting the user. This is useful for power users who want to skip repetitive permission dialogs during a session while keeping the permission system intact.

The implementation uses the existing KV store to persist the toggle state across the session, and auto-replies to permission.asked events when the mode is active.

Changes:

  • TUI session commands: new /yolo slash command in the command palette (toggles on/off)
  • KV store: persists yolo_mode state across the session
  • 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 with reply: "once" when kv.get('yolo_mode') is true

2. Per-agent thinking toggle

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?

YOLO mode:

  • Verified the /yolo command appears in the session command palette
  • Verified toggling updates the KV store and shows the correct toast message
  • Verified the footer and sidebar indicators render conditionally based on KV state
  • Verified the sync handler auto-replies permission events when the mode is enabled

Per-agent thinking:

  • 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 — TUI terminal UI and backend logic, no graphical screenshots.

Checklist

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

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label May 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found a potentially related PR:

PR #12633: feat(tui): add auto-accept mode for permission requests
#12633

This PR appears related as it also adds an auto-approval/auto-accept feature for permissions, though it focuses on the TUI rather than a /yolo command specifically. You may want to review it to ensure there's no overlapping functionality or conflicting approaches.

The other results (PRs #7137 and #22047) are related to permission skipping flags but appear to be different in scope.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label May 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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
@salema97 salema97 changed the title feat(yolo): add /yolo toggle command for auto-approving permissions feat(yolo,agent): add /yolo toggle and per-agent thinking control May 16, 2026
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:title labels May 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Hey! Your PR title feat(yolo,agent): add /yolo toggle and per-agent thinking control doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@salema97 salema97 changed the title feat(yolo,agent): add /yolo toggle and per-agent thinking control feat(opencode): add /yolo toggle and per-agent thinking control May 16, 2026
@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label May 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@salema97
Copy link
Copy Markdown
Author

Closing in favor of two separate PRs:

@salema97 salema97 closed this May 16, 2026
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