TUI slash popup opens for fuzzy-only input but shows no matches
Summary
The TUI slash-command popup can open for fuzzy-only input even though the popup itself now filters commands by exact/prefix match only.
For example, /ac is a fuzzy subsequence match for commands like compact, so looks_like_slash_prefix opens the command popup. The popup's filtered() method then applies exact/prefix filtering and returns no items, leaving a visible popup with no matches.
This is not a request to restore fuzzy slash-command matching. The change keeps the prefix-only behavior consistent and prevents opening an empty popup for inputs that the popup cannot display.
Reproduction
- Start the TUI.
- Type
/acin the composer. - Observe that the command popup opens but shows
no matches.
Patch
Slash-popup-specific diff, stacked on the compile fix from openai/codex#21394:
[https://github.com/misrtjakub/codex/compare/fix/tui-add-to-history-command...fix/tui-slash-popup-prefix-only-stacked?expand=1](<https://github.com/misrtjakub/codex/compare/fix/tui-add-to-history-command...fix/tui-slash-popup-prefix-only-stacked?expand=1>)
Stacked branch against upstream main:
[https://github.com/openai/codex/compare/main...misrtjakub:fix/tui-slash-popup-prefix-only-stacked?expand=1](<https://github.com/openai/codex/compare/main...misrtjakub:fix/tui-slash-popup-prefix-only-stacked?expand=1>)
The stacked branch includes openai/codex#21394 because current origin/main does not compile codex-tui with Cargo without that missing AddToHistory fix.
Validation
cargo test -p codex-tui builtin_prefix_matching_is_prefix_only
cargo test -p codex-tui slash_popup_activated_for_bare_slash_and_valid_prefixes
cargo fmt --check
git diff --check