feat(desktop): add opt-in next prompt suggestions #5629
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #5629"
general
weight: 0.35
liugddx
Summary
Adds opt-in next-prompt suggestions to ordinary AI SDK conversations and WorkHub. After a completed reply, an empty composer may show one suggestion with the same position, typography and wrapping as normal input. Tab accepts an editable draft; clicking focuses the input without accepting; Enter sends and Esc dismisses. Typing, navigation, hidden interaction forms and newer turns invalidate stale results.
Runtime Host owns bounded, tool-free prediction requests through the existing credential/model authority, with usage metering, a five-second timeout and per-turn deduplication. The feature defaults off. WorkHub admits only its permanent coordination identity and uses recent visible conversation rather than the session's distant original task. Background subagents and other existing eligibility restrictions remain excluded. The overlay stays outside contenteditable and has no layout-measuring state loop.
Rebased onto main
acaa29e40, preserving delegated-result notifications and the updated executor picker.Refs #4117. A separate investigation exercised 2,040 natural Chromium cases without reproducing React 185. Artificial geometry oscillation also did not reproduce the crash. The old engine came from Maka's Astryx patch. This PR corrects overly certain historical commentary; it does not claim to fix that crash.
The opt-in setting is a renderer-local preference, not a Host authorization boundary. Authenticated remote owners can invoke prediction just as they can invoke paid turns.
Review fixes add unique per-call usage IDs, click-through ghost text, automated-session/turn filtering, a deadline covering source reads, recovery after transient reconciliation failures, and collapsed WorkHub geometry constraints. Review artifacts are excluded from the current branch; the historical evidence below uses a fixed commit link. Native ordinary/WorkHub acceptance and 60 Host tests passed after the review changes; full build, typecheck and formatting passed.
Additional review fixes: read user messages through
userFacingText, synchronize the opt-in across renderer storage events, share first-line/think-tag cleanup with title generation, and keep operation residency until actual model cleanup completes. Declared reasoning models without a supportedofflevel are skipped before provider invocation; supported requests explicitly disable reasoning and retries. Prediction costs count toward the session totals and cache-hit statistics. The bounded per-turn result cache remains to prevent duplicate paid requests across clients; it is insertion-ordered, not LRU.Validation includes provider request reasoning fields, truncated responses, no retry on HTTP 503, a reasoning-only model making zero provider requests, source-identity changes without reconciliation, and close waiting for delayed model cleanup. The cross-renderer adapter event test and WorkHub native acceptance pass. A full multi-window UI journey, exhaustive Host eligibility table and IME/mention-menu Tab cases were not added in this revision.
Verification
Product/WorkHub/NextPromptSuggestionuses the production WorkHubRoot/controller/Composer with mocked service transport. All four real Chromium plays completed at 1280/720px × light/dark, including exact before/after-Tab glyph rectangles and typography, accepted Enter and Esc.playFunctionThrewExceptionlistener in the smoke probe; the listener and regression coverage are included. Smoke-runner unit tests: 15 passed. The CI catalog explicitly schedules the four viewport/theme combinations.Historical UI evidence and reproduction commands (before review fixes)
Screenshots are from the built Storybook in the in-app browser; the assertion matrix ran in Ego Chromium. Ego screenshot calls timed out, so these are not labeled as Ego captures.
!WorkHub light, 1280px
!WorkHub dark, 720px
AI use
Tool(s) and scope: OpenAI Codex implemented the feature, tests and documentation; local Claude Code was used during initial behavior research. Generated-by trailers are included.
Checklist
Does this PR entail a change in behavior?