Skip to content

feat(detection): support Codex Reasoning Level numbered prompt (#616)#617

Merged
Kewton merged 2 commits intodevelopfrom
feature/616-codex-reasoning-level-prompt
Apr 3, 2026
Merged

feat(detection): support Codex Reasoning Level numbered prompt (#616)#617
Kewton merged 2 commits intodevelopfrom
feature/616-codex-reasoning-level-prompt

Conversation

@Kewton
Copy link
Copy Markdown
Owner

@Kewton Kewton commented Apr 3, 2026

Summary

  • Codex CLIのReasoning Level選択UIをmultiple_choice promptとして正しく検出できるようprompt-detect-multiple-choice.tsを拡張
  • SubmitMode型(answer_only / answer_then_enter)をmodels.tsに追加し、Codex numbered promptの入力契約を明示的にモデル化
  • respond/route.tsprompt-response/route.tssubmitModeに応じた送信制御を実装
  • テスト316件追加(prompt-answer-sender, prompt-response-body-builder, prompt-detector)

Closes #616

Test plan

  • npm run lint — PASS
  • npx tsc --noEmit — PASS
  • npm run test:unit — 6052 passed
  • npm run build — PASS

🤖 Generated with Claude Code

Kewton and others added 2 commits April 4, 2026 01:37
…rompt with submitMode

- Add SubmitMode type ('answer_only' | 'answer_then_enter') to MultipleChoicePromptData
- Extend CONFIRMATION_FOOTER_PATTERN to detect "press number to confirm" footer
- Derive submitMode from footer pattern in detectMultipleChoicePrompt()
- Add submitMode-aware Enter suppression in sendPromptAnswer() with fail-safe fallback
- Include submitMode in buildPromptResponseBody() for client-server propagation
- Delegate respond/route.ts to sendPromptAnswer() (remove direct sendKeys)
- Add fallbackSubmitMode support in prompt-response/route.ts with allowlist validation
- All 6052 unit tests pass, 0 lint/type errors

Resolves #616

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…cation

- Extract isValidSubmitMode type guard to src/types/models.ts for shared
  allowlist validation (was duplicated in prompt-answer-sender and route)
- Extract resolveSubmitMode and shouldSuppressEnter helpers in
  prompt-answer-sender.ts for clearer intent and testability
- Combine two scanWindow iterations into single-pass footer detection in
  prompt-detect-multiple-choice.ts to avoid redundant iteration

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant