feat(composer): prompt suggestions after agent turns#473
feat(composer): prompt suggestions after agent turns#473joshhbk wants to merge 3 commits intoDimillian:mainfrom
Conversation
|
Yes! Claude Code does it and I use it quite often. I'm quite sure it will be implemented in codex soon too. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8d2d1c089c
ℹ️ 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".
|
There is currently conflicts + it needs a setting that is off by default, we can't really introduce that as a global on + Codex found a few issues |
8d2d1c0 to
8088212
Compare
@Dimillian addressed comments + rebased + moved to experimental features 👍🏻 |
|
@codex review |
|
Hmm with the setting on it never generate the next message for me |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cc0acc8961
ℹ️ 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".
@Dimillian that's weird, it worked first time for me when testing again - the prompt is setup to not "force" a suggestion if there's nothing obvious to contribute, is it possible you just had a run of messages it didn't feel like there was an obvious follow? |
After an agent turn completes, predict the user's likely next message and show it as ghost text in the composer. Uses the fastest available model (spark > mini > default), caps output to 30 tokens, and skips suggestions when there's no natural follow-up. Includes cross-fade placeholder transition, Tab-to-accept, and test coverage.
948768e to
c456704
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4567044e3
ℹ️ 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".
…ictions Cancel in-flight predictions when a new turn starts, skip predictions when the last item isn't assistant-originated, and cap lastParagraph output to 2000 chars to prevent oversized payloads.


What
After an agent turn completes, predict the user's likely next message and display it as a prompt suggestion in the composer. Tab accepts the suggestion, typing dismisses it.
The frontend picks the fastest available model (spark > mini > workspace default), caps output at 30 tokens, and the prompt instructs the model to return nothing when there's no natural follow-up (e.g. agent just delivered code with no question).
The native textarea placeholder is replaced with a styled overlay so placeholder and suggestion cross-fade smoothly instead of swapping abruptly.
Why
Reduces friction in conversational workflows where the next user message is predictable — confirming an action, answering a question, or picking from offered options. Using a fast model and short token cap keeps latency low and avoids wasting resources on a lightweight task.
Test plan
npx vitest run src/features/composer/hooks/usePredictedResponse.test.ts— 14 tests passcargo test -- build_predict_response_prompt— 2 tests passDemo
prompt-suggestion-demo.mov