Skip to main content
CodeMachine uses a hierarchical configuration system for engine and model selection. Each layer can override the previous, giving you fine-grained control.

Agent Config

Override in main.agents.js

Workflow Step

Override in workflow.js

Runtime Execution

Final resolution with auth fallback

Available Engines

Engines other than claude, codex, and opencode are experimental and might not be stable.

Agent Configuration

Configure engine and model in config/main.agents.js for individual agents.

Agent Schema

Examples

Engine + Model:
With Reasoning Effort (Codex only):
Engine Only (uses engine’s default model):

Workflow Step Overrides

Override engine and model per step in your workflow.js files.

Override Schema

Using resolveStep()

Using resolveFolder()

Apply overrides to all steps from a folder:

Using resolveModule()

Model Reasoning Effort

Only supported by certain engines (currently Codex).

Practical Examples

Fast Prototyping

Use faster, cheaper models:

Production Quality

Use powerful models:

Mixed Engine Workflow

Leverage different engines for their strengths:

Engine Fallback System

When running a workflow, CodeMachine resolves the engine and model through a fallback system.

How It Works

1

Pick Engine

  • Use step/CLI override if specified
  • Else use agent config (engine field)
  • Else find first authenticated engine by order
2

Check Authentication

  • If selected engine is not authenticated → try next authenticated engine
  • If none authenticated → use registry default (first by order)
3

Select Model

  • If engine fell back, agent’s model is ignored (uses engine’s default)
  • Otherwise: step override → agent config → engine default

Default Engine & Model

Default engine: opencode (order: 1) Default model: opencode/big-pickle

Engine Fallback Order

Engines are tried in this order when falling back:
If no engine is specified and opencode is authenticated, it’s used. If opencode isn’t authenticated, it tries claude, then codex, and so on.

Validation

The workflow validator checks:
  • model must be a string (if provided)
  • modelReasoningEffort must be 'low', 'medium', or 'high'
  • engine must be a valid engine ID from the registry
Invalid configurations produce descriptive error messages during workflow loading.