Skip to content

Epic: Per-Agent Options (Model, MCP/Skills, Variant) – AgentOptions #22

Description

@maddes8cht

Description

Currently, every opencode run invocation starts without additional flags – model, MCP servers, or skills are not controlled. A workflow should be able to specify per-agent:

  • Model (--model / -m): e.g. anthropic/claude-sonnet-4 for the author, openai/gpt-4o for the auditor
  • MCP servers / Skills (--pure or targeted selection): e.g. --pure for a simple code generator, or specific MCP servers for a research agent
  • Other opencode options like --variant (reasoning effort)

This configuration must be settable via GUI, CLI, and workflow JSON.

Prerequisite

This issue builds on #23. Issue #23 provides the base infrastructure:

  • OpenCodeOptions dataclass with to_cli_args()
  • OpenCodeRunner.run() accepts OpenCodeOptions
  • Global defaults in Config and WorkflowConfig

#23 must be completed before this issue can be implemented.

Design

1. Data Model: AgentOptions

Extends OpenCodeOptions from #23 with per-agent-specific fields:

@dataclass
class AgentOptions(OpenCodeOptions):
    # Inherits: model, agent, variant, pure, log_level, extra_args
    pass  # initially identical – extensions possible later

Alternative: agent_options: dict[str, OpenCodeOptions] in WorkflowConfig (simpler, no new dataclass needed).

2. Storage Locations (Override Order)

CLI --agent-options  >  Workflow JSON (agent_options.{name})  >  Agent Frontmatter  >  Workflow Defaults (#23)  >  Config Defaults (#23)

(a) Agent Frontmatter (default per agent):

---
name: amala
role: author
model: anthropic/claude-sonnet-4
pure: true
---

(b) Workflow JSON (override per agent):

{
  "loop_agents": ["amala", "vera"],
  "agent_options": {
    "amala": { "model": "anthropic/claude-sonnet-4", "pure": true },
    "vera":  { "model": "openai/gpt-4o", "variant": "high" }
  }
}

(c) CLI (global override for all agents):

python openloop.py --cli --workflow wf.json --agent-options "model=openai/gpt-4o"

3. Runner Extension

OpenCodeRunner.run() gets a parameter agent_opts: Optional[OpenCodeOptions] = None – builds additional CLI flags (merged with global defaults from #23).

4. GUI Extension

Per agent in the slot an Options button (gear icon) that opens a dialog:

Agent Options: amala
+----------------------------------+
| Model:  anthropic/claude-sonnet-4 |
| Variant: [high | max | minimal]   |
| X Pure mode (no plugins)         |
| Extra Args: [______________]      |
+----------------------------------+

Sub-Issues (ToDo)

Scope

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