Keep startup prompts interactive#2373
Conversation
There was a problem hiding this comment.
Code Review
This pull request changes the top-level prompt flag (-p / --prompt) behavior to start an interactive TUI session and automatically submit the initial prompt, rather than running in a non-interactive one-shot mode. Non-interactive runs are now directed to use the exec command. To support this, an InitialInput enum is introduced with Prefill and Submit variants. The review feedback correctly identifies a potential bug where text.len() is used to set the cursor position instead of text.chars().count(), which could lead to incorrect cursor placement or panics when handling multi-byte UTF-8 characters.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7b0562a10f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Updated the PR description after follow-up validation. Review feedback addressed in
Re-ran direct command-line equivalent CLI/TUI behavior tests on this Windows checkout:
Full workspace validation is green in PR CI on Ubuntu, macOS, and Windows. |
Summary
codewhale prstill pre-fills editable text whilecodewhale --promptauto-submits the initial request.Testing
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-featurescargo test -p codewhale-cli --lib --all-featurescargo test -p codewhale-cli --lib --all-features top_levelcargo test -p codewhale-tui --bin codewhale-tui --all-features prompt_flag_starts_interactive_submit_inputcargo test -p codewhale-tui --bin codewhale-tui --all-features initial_input_cargo test -p codewhale-tui --bin codewhale-tui --all-features startup_prompt_waits_for_onboarding_then_dispatchescargo test --workspace --all-featuresubuntu-latest,macos-latest, andwindows-latest.Lint,Version drift,Test (ubuntu-latest),Test (macos-latest),Test (windows-latest),npm wrapper smoke,GitGuardian, andGreptile Reviewall passed.Checklist
prompt_flag_starts_interactive_submit_input,initial_input_, andstartup_prompt_waits_for_onboarding_then_dispatches.Closes #2370