Skip to content

feat(cli): autoforge loop --mode goals --backend {auto,claude,codex} を追加 (#30 PR2) #32

Description

@k-buchi4696

親 issue

#30 — 非対話 agent driver の PR2 (CLI integration + PATH auto-detection)

前提

ゴール

`autoforge loop` サブコマンドに以下を追加:

  • `--mode {pipeline,goals}` (default: `pipeline`、既存挙動を温存)
  • `--backend {auto,claude,codex}` (default: `auto`)
  • `auto` は `which claude` → `which codex` の順で PATH 検出

タスク

  • `autoforge/harness/agent_loop.py` に `detect_backend() -> Backend | None` を追加
  • `autoforge/cli.py` の loop_parser に `--mode` / `--backend` を追加
  • `_run_loop` を `--mode` でディスパッチ(`pipeline` は既存、`goals` は PR3 でフィルする想定で本 PR では暫定 NotImplementedError or stub log)
  • PATH 検出のテスト(claude のみ / codex のみ / 両方なし)
  • CLI 引数パース回帰テスト

受け入れ条件

  • `autoforge loop --mode pipeline` が既存挙動で動く(回帰なし)
  • `autoforge loop --mode goals --backend auto` が PATH 検出を試みる
  • PATH に何も無い環境で適切なエラー
  • 既存テスト全 pass

想定行数

~180 行(実装 + テスト)

非ゴール

  • goals の実行ロジック → PR3
  • ドキュメント → PR4

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