Skip to content

feat(composer): prompt suggestions after agent turns#473

Open
joshhbk wants to merge 3 commits intoDimillian:mainfrom
joshhbk:feat/prompt-suggestions
Open

feat(composer): prompt suggestions after agent turns#473
joshhbk wants to merge 3 commits intoDimillian:mainfrom
joshhbk:feat/prompt-suggestions

Conversation

@joshhbk
Copy link
Contributor

@joshhbk joshhbk commented Feb 21, 2026

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

  • Trigger a suggestion by completing a turn where the agent asks a question — suggestion should appear
  • Complete a turn where the agent just outputs code with no question — no suggestion should appear
  • Press Tab to accept the suggestion, verify it populates the composer
  • Start typing while a suggestion is visible — it should dismiss
  • Switch threads while processing — suggestion should not carry over
  • With no spark/mini models available, suggestions should still work using the default model
  • npx vitest run src/features/composer/hooks/usePredictedResponse.test.ts — 14 tests pass
  • cargo test -- build_predict_response_prompt — 2 tests pass

Demo

image
prompt-suggestion-demo.mov

@vforsh
Copy link
Contributor

vforsh commented Feb 21, 2026

Yes! Claude Code does it and I use it quite often. I'm quite sure it will be implemented in codex soon too.

@Dimillian
Copy link
Owner

@codex review

Copy link

@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: 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".

@Dimillian
Copy link
Owner

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

@joshhbk joshhbk force-pushed the feat/prompt-suggestions branch from 8d2d1c0 to 8088212 Compare February 22, 2026 16:41
@joshhbk
Copy link
Contributor Author

joshhbk commented Feb 22, 2026

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

@Dimillian addressed comments + rebased + moved to experimental features 👍🏻

@Dimillian
Copy link
Owner

@codex review

@Dimillian
Copy link
Owner

Hmm with the setting on it never generate the next message for me

Copy link

@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: 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".

@joshhbk
Copy link
Contributor Author

joshhbk commented Feb 23, 2026

Hmm with the setting on it never generate the next message for me

image

@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.
@joshhbk joshhbk force-pushed the feat/prompt-suggestions branch from 948768e to c456704 Compare February 24, 2026 03:26
@Dimillian
Copy link
Owner

@codex review

Copy link

@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: 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.
@joshhbk
Copy link
Contributor Author

joshhbk commented Feb 24, 2026

codex issues addressed + retested

image

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.

3 participants