Skip to content

fix: Codex CLIの確認プロンプトが検出されずポップアップが表示されない #372

@Kewton

Description

@Kewton

概要

Codex CLIのコマンド実行確認プロンプト(「Would you like to run the following command?」)がプロンプト検出システムで認識されず、MobilePromptSheet/PromptPanelのポップアップが表示されない。

再現手順

  1. Codex CLIでセッションを開始
  2. Codexがコマンド実行確認を求めるプロンプトを表示する
  3. ターミナル上にはプロンプトが表示されるが、選択用ポップアップが表示されない

Codexのプロンプト形式

Would you like to run the following command?

  $ npm run test:e2e -- tests/e2e/mobile-cmate-tab.spec.ts

› 1. Yes, proceed (y)
  2. Yes, and don't ask again for commands that start with 'npm run test:e2e' (p)
  3. No, and tell Codex what to do differently (esc)

Press enter to confirm or esc to cancel

原因

prompt-detector.tsdetectPrompt() 関数がClaude専用のパターンを前提としている。

現在対応しているパターン

  • (y/n), [Y/n], (yes/no) — yes/noパターン
  • Approve? — 承認パターン
  • マーカー付き番号リスト — multiple choiceパターン

Codexのプロンプトがマッチしない理由

  1. detectMultipleChoicePrompt() マーカーを必須としているが、Codexは (入力プロンプト)と番号リストが別
  2. YES_NO_PATTERNS に「Would you like to run」形式がない
  3. Codexの選択肢は N. Text (key) 形式で既存パターンと異なる

対応方針

prompt-detector.ts にCodexのプロンプトパターン検出を追加する。

検出ロジック

以下の条件をANDで判定:

  1. Would you like to run または Press enter to confirm を含む行がある
  2. 番号付き選択肢(1., 2., 3.)が存在する

変更対象ファイル

ファイル 変更内容
src/lib/cli-patterns.ts Codexコマンド確認プロンプトのパターン定数を追加
src/lib/prompt-detector.ts detectPrompt() にCodexプロンプト検出ロジックを追加
tests/unit/prompt-detector.test.ts Codexプロンプト検出のテストケースを追加

受け入れ基準

  • Codexの「Would you like to run the following command?」プロンプトが検出される
  • 検出時にMobilePromptSheet/PromptPanelのポップアップが表示される
  • 選択肢(Yes, proceed / Yes, and don't ask again / No)が正しく表示される
  • 既存のClaude/Geminiプロンプト検出に影響がない
  • ユニットテストが追加されている

参考

  • 設計レビュー: IS-MF-001 (Must Fix)
  • プロンプト検出: src/lib/prompt-detector.ts L103-221
  • CLIパターン: src/lib/cli-patterns.ts L76-84
  • スクリーンショット: workspace/ss/Screenshot_20260227-165727.png

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