Skip to content

feat(tui): render next prompt suggestions [3 of 3]#23976

Open
fcoury-oai wants to merge 1 commit into
fcoury/next-suggestion-apifrom
fcoury/next-suggestion
Open

feat(tui): render next prompt suggestions [3 of 3]#23976
fcoury-oai wants to merge 1 commit into
fcoury/next-suggestion-apifrom
fcoury/next-suggestion

Conversation

@fcoury-oai
Copy link
Copy Markdown
Contributor

@fcoury-oai fcoury-oai commented May 22, 2026

Why

After the app-server can produce a next-prompt suggestion, the TUI needs to request it at the right moments and show it as lightweight composer ghost text without submitting on behalf of the user.

What changed

  • Request next-prompt suggestions after completed primary-thread turns and after resume/fork/new-thread attachment.
  • Ignore stale results and cancel pending suggestion work when the user types, pastes, rewinds, or changes thread state.
  • Preserve the last visible suggestion when the user clears a draft, while clearing stale suggestions on rollback/backtrack.
  • Render suggestions as empty-composer ghost text and accept them with Tab without immediately submitting.
  • Add focused TUI coverage and the empty-composer snapshot.

Testing

  • RUST_MIN_STACK=8388608 CARGO_TARGET_DIR=/private/tmp/codex-next-suggestion-stack-target cargo test -p codex-tui next_prompt_suggestion
  • cargo insta pending-snapshots --manifest-path tui/Cargo.toml
  • CARGO_TARGET_DIR=/private/tmp/codex-next-suggestion-stack-target ./tools/argument-comment-lint/run.py -p codex-core -p codex-app-server-protocol -p codex-app-server -p codex-tui

Manual smoke retained from the original combined PR: a fresh temporary-home TUI session produced the expected ghost-text suggestion after a completed turn; resumed thread attachment invoked thread/suggestNextPrompt; incomplete active tool flow suppressed suggestions instead of showing stale text.

Stack

  1. #24126 next-prompt suggestion engine
  2. #24127 next-prompt app-server RPC
  3. feat(tui): render next prompt suggestions [3 of 3] #23976 next-prompt TUI (this PR)

@fcoury-oai fcoury-oai requested a review from a team as a code owner May 22, 2026 01:21
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6c55c12f7e

ℹ️ 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".

Comment thread codex-rs/tui/src/app/input.rs
Comment thread codex-rs/tui/src/app/next_prompt_suggestion.rs Outdated
Comment thread codex-rs/tui/src/app/next_prompt_suggestion.rs
Comment thread codex-rs/tui/src/app/next_prompt_suggestion.rs
Comment thread codex-rs/core/src/next_prompt_suggestion.rs
@fcoury-oai fcoury-oai force-pushed the fcoury/next-suggestion branch from da376d6 to 0be847c Compare May 22, 2026 02:27
@fcoury-oai fcoury-oai force-pushed the fcoury/next-suggestion branch from 0be847c to c749a94 Compare May 22, 2026 18:45
@fcoury-oai fcoury-oai changed the title feat(tui): add next prompt suggestions feat(tui): render next prompt suggestions May 22, 2026
@fcoury-oai fcoury-oai changed the base branch from main to fcoury/next-suggestion-api May 22, 2026 18:46
@fcoury-oai fcoury-oai changed the title feat(tui): render next prompt suggestions feat(tui): render next prompt suggestions [3 of 3] May 22, 2026
@fcoury-oai fcoury-oai force-pushed the fcoury/next-suggestion-api branch from ebf3205 to ea98223 Compare May 22, 2026 19:25
@fcoury-oai fcoury-oai force-pushed the fcoury/next-suggestion branch from c749a94 to 750cc7e Compare May 22, 2026 19:25
@fcoury-oai fcoury-oai force-pushed the fcoury/next-suggestion-api branch from ea98223 to 4c9c125 Compare May 22, 2026 20:16
@fcoury-oai fcoury-oai force-pushed the fcoury/next-suggestion branch from 750cc7e to 4aa8ee6 Compare May 22, 2026 20:16
@fcoury-oai fcoury-oai force-pushed the fcoury/next-suggestion-api branch from 4c9c125 to ed2c40a Compare May 22, 2026 22:15
@fcoury-oai fcoury-oai force-pushed the fcoury/next-suggestion branch from 4aa8ee6 to d29c381 Compare May 22, 2026 22:15
@fcoury-oai fcoury-oai force-pushed the fcoury/next-suggestion-api branch from ed2c40a to 02683d5 Compare May 22, 2026 22:51
@fcoury-oai fcoury-oai force-pushed the fcoury/next-suggestion branch from d29c381 to 4054461 Compare May 22, 2026 22:51
@fcoury-oai fcoury-oai force-pushed the fcoury/next-suggestion-api branch from 02683d5 to 774f228 Compare May 22, 2026 22:57
@fcoury-oai fcoury-oai force-pushed the fcoury/next-suggestion branch from 4054461 to c52d0e5 Compare May 22, 2026 22:57
@fcoury-oai fcoury-oai force-pushed the fcoury/next-suggestion-api branch from 774f228 to 14760db Compare May 22, 2026 23:01
@fcoury-oai fcoury-oai force-pushed the fcoury/next-suggestion branch from c52d0e5 to c8d8cbd Compare May 22, 2026 23:01
@fcoury-oai fcoury-oai force-pushed the fcoury/next-suggestion-api branch from 14760db to 072c55c Compare May 23, 2026 02:17
@fcoury-oai fcoury-oai force-pushed the fcoury/next-suggestion branch from c8d8cbd to e470cae Compare May 23, 2026 02:17
@fcoury-oai fcoury-oai force-pushed the fcoury/next-suggestion-api branch from b003831 to 415c590 Compare May 23, 2026 19:44
@fcoury-oai fcoury-oai force-pushed the fcoury/next-suggestion branch from e470cae to f00ebd6 Compare May 23, 2026 19:45
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