Skip to content

fix: --run-batches --runner claude silently falls through to codex subprocess #610

Description

@dmg604

Problem

When --run-batches --runner claude is used, _select_batch_runner in batch/orchestrator.py silently falls through to run_codex_batch, which spawns a codex subprocess. In environments where codex is not available (e.g. Claude Code sessions), this produces a silent failure or cryptic error with no guidance on the correct workflow.

Expected behavior

--runner claude should fail fast with a clear error explaining that Claude is not a subprocess runner and describing the correct workflow.

Correct workflow for Claude

desloppify review --run-batches --dry-run
# launch one subagent per prompt file in .desloppify/subagents/runs/<run>/prompts/
# each writes JSON to results/batch-N.raw.txt
desloppify review --import-run <run-dir> --scan-after-import

Fix

In _select_batch_runner, add a claude case that raises CommandError with the correct instructions instead of falling through to run_codex_batch:

if normalized == "claude":
    raise CommandError(
        "The 'claude' runner does not spawn subprocesses. "
        "Use --run-batches --dry-run to generate prompt files, "
        "launch one subagent per prompt file, write JSON output to "
        "results/batch-N.raw.txt, then import with "
        "--import-run <run-dir> --scan-after-import.",
        exit_code=1,
    )

5810 existing tests pass with this change applied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions