You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
@dataclassclassAgentOptions(OpenCodeOptions):
# Inherits: model, agent, variant, pure, log_level, extra_argspass# initially identical – extensions possible later
Alternative: agent_options: dict[str, OpenCodeOptions] in WorkflowConfig (simpler, no new dataclass needed).
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: [______________] |
+----------------------------------+
Description
Currently, every
opencode runinvocation starts without additional flags – model, MCP servers, or skills are not controlled. A workflow should be able to specify per-agent:--model/-m): e.g.anthropic/claude-sonnet-4for the author,openai/gpt-4ofor the auditor--pureor targeted selection): e.g.--purefor a simple code generator, or specific MCP servers for a research agent--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:
OpenCodeOptionsdataclass withto_cli_args()OpenCodeRunner.run()acceptsOpenCodeOptions#23 must be completed before this issue can be implemented.
Design
1. Data Model:
AgentOptionsExtends
OpenCodeOptionsfrom #23 with per-agent-specific fields:Alternative:
agent_options: dict[str, OpenCodeOptions]inWorkflowConfig(simpler, no new dataclass needed).2. Storage Locations (Override Order)
(a) Agent Frontmatter (default per agent):
(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 parameteragent_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:
Sub-Issues (ToDo)
AgentLoaderreads model/agent/variant/pure/extra_args from YAML frontmatteragent_options: dict[str, OpenCodeOptions]inWorkflowConfig, serialization infrom_dict()/to_dict()_execute_agent()merges: Config Defaults (Global OpenCode Defaults (opencode_defaults) for Model, Agent, Variant, Pure, etc. #23) > Workflow Defaults (Global OpenCode Defaults (opencode_defaults) for Model, Agent, Variant, Pure, etc. #23) > Agent Frontmatter > Workflow agent_options > CLI Overrides--agent-optionsflagScope
Config (#23) > Workflow (#23) > Agent Frontmatter > Workflow agent_options > CLI > Runner