Skip to content

Engine option in resolveModule() is ignored - always falls back to Codex #37

@ReWrite94

Description

@ReWrite94

When using resolveModule() in a workflow with engine: 'claude' specified, the engine option is ignored and CodeMachine attempts to use Codex instead, even when:

  1. Codex CLI is not installed
  2. The workflow explicitly sets engine: 'claude'
  3. The module config in config/modules.js has engine: 'claude'

Steps to Reproduce

  1. Configure a workflow with a module using Claude engine:
// codemachine.workflow.js
export default {
  name: 'My Workflow',
  steps: [
    resolveStep('some-agent', { engine: 'claude' }),  // Works fine
    resolveModule('check-task', { engine: 'claude', loopSteps: 6 }),  // Fails
  ],
};
  1. Optionally add engine: 'claude' to the module config:
// config/modules.js
{
  id: 'check-task',
  name: 'Task Completion Checker',
  promptPath: '...',
  engine: 'claude',  // Also ignored
  behavior: { type: 'loop', action: 'stepBack' },
}
  1. Run the workflow with /start

Expected Behavior

The check-task module should execute using Claude as specified.

Actual Behavior

error: Codex authentication required
    at d$ (/$bunfs/root/runner-process.js:114:9)
    at async N5 (/$bunfs/root/runner-process.js:114:706)
    at async b4 (/$bunfs/root/runner-process.js:299:2259)
    at async mz (/$bunfs/root/runner-process.js:624:6766)
    at async iz (/$bunfs/root/runner-process.js:645:1044)

Analysis

Looking at the minified source, the engine resolution logic appears to be:

if(R)s=R;else if(DA.engine)s=DA.engine;else{...fallback}

For resolveStep(), the engine parameter (R) is properly passed through. However, for resolveModule(), neither the workflow option nor the module config's engine property appears to be read, causing it to fall through to the fallback which defaults to Codex.

Environment

  • CodeMachine version: 0.7.0
  • OS: macOS
  • Claude CLI: Installed and authenticated
  • Codex CLI: Not installed

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions