Skip to content

Feature: persist default model/agent via /opencode:setup #20

Closed

Description

@JohnnyVicious

Motivation

Users who consistently prefer a specific provider/model (e.g. anthropic/claude-opus-4-6) or agent (build vs plan) have to pass --model or --agent on every command invocation of /opencode:review, /opencode:adversarial-review, and /opencode:rescue. The setup command already persists state like the review gate toggle via state.config in plugins/opencode/scripts/lib/state.mjs, so it's a natural place to store defaults.

Proposed UX

/opencode:setup --default-model anthropic/claude-opus-4-6 --default-agent build
/opencode:setup  # displays current defaults

Defaults apply to all commands (task, review, adversarial-review) unless overridden per invocation with explicit --model / --agent.

Implementation sketch

  • handleSetup in opencode-companion.mjs accepts --default-model / --default-agent and writes them to state.config.defaults.
  • handleReview, handleAdversarialReview, handleTask read state.config.defaults and apply them when the caller hasn't passed the flag explicitly.

Upstream reference

Derived from openai/codex-plugin-cc#44.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions