Skip to content

feat: support LLM-free command execution (follow upstream #28292) #5

@Svtter

Description

@Svtter

Background

The /review:auto command toggles auto-review on/off. Currently it works by having an LLM agent parse the user's argument and call the toggle_auto_review tool. This means:

  • Wastes an LLM call just to flip a boolean (unnecessary tokens + latency)
  • Logic depends on the LLM's interpretation, which is fragile
  • State is in-memory only, lost on restart

Desired behavior

The command.execute.before hook should be able to:

  1. Parse the argument directly (on / off)
  2. Update the state
  3. Return a response to the user
  4. Skip the LLM call entirely

Upstream dependencies

Temporary workaround (until upstream merges)

  • Persist autoEnabled state to a file (.opencode/.review-state.json) so users can also edit it directly
  • Pre-process the toggle logic in command.execute.before, so the LLM only echoes the result

Metadata

Metadata

Assignees

No one assigned

    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