Repository navigation
Composer: suggest the next prompt after Claude and Codex turns (Tab fills it) - #1216
Merged
Merged
Conversation
…ills it) Opt-in "Suggest next prompt" setting (Settings > Chat, shared across devices). After a completed Claude or Codex turn the empty composer shows the provider's predicted next message with a Tab hint; Tab fills it in, Escape hides it for that turn. - Claude: the Agent SDK's promptSuggestions option; its prompt_suggestion message is tied to the turn that just finished, and dropped once a newer turn opened. - Codex: the experimental thread/sample request (0.165+) after each completed root turn, skipping failed and /compact turns; failures are quiet. - Kept as one latest-state activity per thread (prompt.suggestion), so it survives reloads and reconnects and reaches every client; hidden from the timeline and compacted in the event log. Ported from T3 Code's Labs option (pingdotgg/t3code#28047). Co-Authored-By: Claude Opus 5.5 <[email protected]>
… boot path - Migration 026 wraps each json_group_array subquery in json(...). SQLite 3.54 (CI's Node 24.22.3) no longer carries the JSON subtype out of a scalar subquery, so json_set stored the canonicalized options as a string and 026_CanonicalizeModelSelectionOptions.test.ts failed. - Runtime ingestion spells out the prompt.suggestion kind instead of importing @ryco/shared/promptSuggestion, which moves that module out of the boot chunk (-0.76 KB); the ingestion test checks it against the shared constant. - Server boot cap 7,316,000 for what every boot needs of prompt suggestions (measured 7,314,409). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claude Code and Codex can both predict your next message after a turn (Claude Code's prompt suggestions, the Codex app's Tab suggestion). T3 Code shipped this as a Labs option (pingdotgg/t3code#28047). Ryco never showed either.
Now there is an opt-in setting, Suggest next prompt (Settings > Chat > Suggestions, a machine setting shared across devices, off by default). When it is on and a Claude or Codex turn completes, the empty composer shows the predicted next message with a
Tabkey hint. Tab fills it in (then edit or send), Escape hides it for that turn in every open composer.How it works
promptSuggestionsserver setting, shareable since sharing version 2, with apromptSuggestionsnode capability so older nodes show the row disabled. Adapters read it live throughreadPromptSuggestionsSetting: Claude when a session opens (open Claude chats follow a change after a restart), Codex after every turn.promptSuggestionsoption. Itsprompt_suggestionmessage arrives afterresult; it is tied to the turn that just finished (lastFinishedTurn) and dropped when that turn did not complete or a newer turn is already open. Claude Code itself skips the first turn, plan mode and turns near the usage limit.thread/sample(Codex 0.165+, Ryco already initializes withexperimentalApi) on a hidden fork sharing the turn's prompt cache,effort: "low", same prompt as T3. Skips failed turns and turns started by/compact. Forked into the session scope and best effort: errors (old Codex, the user already sent again) are logged at debug.turn.prompt-suggestionruntime event is projected as one latest-state activity per thread (prompt-suggestion:<threadId>:latest, kindprompt.suggestion, compacted in the event log, coalesced live, hidden from the timeline). So it survives reloads and reconnects and reaches every client, Hub relay included, through the existing thread stream, with no new RPC.derivePromptSuggestionoffers it only while its turn is the thread's latest and completed. Not offered while running, sending or connecting, over approvals, questions or plan feedback, with an unavailable machine or terminal contexts, on the phone tier, or on devices without a fine pointer (Tab is the only way to accept). Tab goes throughapplyPromptReplacementlike any insert, afteronComposerIntent("type"). Shift+Tab (mode switch) and Tab in the//@menu are unchanged. The editor now also routes Escape through its command plugin.Verification
bun run checkpasses;bun run check:changedpassed apart from two failures that reproduce without this change's code paths:026_CanonicalizeModelSelectionOptions.test.ts(known local-only failure) and a mobilereactCompilerCoveragelicense-file rename race (passes alone)./compactturns, the last checked to fail without its guard), ingestion projection, latest-state groups, normalization, selection, key handling, and a full-app browser test (suggestion + Tab hint shown, Tab fills it, Escape hides it and Tab then does nothing).thread/samplewith these params returns{ sourceTurnId, responseId, text, inputTokens, cachedInputTokens, outputTokens }; one sample on a tiny thread used ~22.6k input tokens (18.5k cached) and 18 output tokens. Claude's path was not run against the real CLI.Not included
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.