Skip to content

feat(composer): add next-message predictions - #6568

Merged
M4n5ter merged 1 commit into
rust-previewfrom
feat/composer-predictions
Nov 2, 2026
Merged

M4n5ter merged 1 commit into
rust-previewfrom
feat/composer-predictions

Conversation

@M4n5ter

@M4n5ter M4n5ter commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds next-message suggestions to the empty composer after a reply and when reopening a conversation. Muted inline text and a trailing acceptance hint follow the ChatGPT interaction. Tab, Right Arrow, Enter, or clicking the hint inserts an editable, undoable draft; Escape dismisses it. Typing and IME composition hide the preview. Failures stay out of the chat UI and are logged.

Predictions are enabled by default, with 100% reply sampling and 50% reopen sampling. Agent-created sessions (parentSessionId != null) are always excluded. Settings → General → Message predictions adds Only for regular conversations, off by default: enabling it additionally excludes the registered Bot. The interface does not expose the internal session classification.

The General settings table supports both switches, fractional sampling percentages, and editing/restoring instructions. English defaults match the observed ChatGPT prompt; Simplified and Traditional Chinese defaults translate it. The original one-line/240-character guidance remains in the prompt without an extra hard parser rejection.

Prediction extends the completed conversation's frozen Main request and verifies its exact prefix before dispatch. It reuses the model, reasoning, system instructions, tool declarations, provider options, output budget, and tool choice. The auxiliary path accounts for usage without dispatching local tools or appending conversation events. Cancellation and source/configuration changes retire stale results. No temporary conversation is created, and there is no separate prediction model/effort configuration or global frontend inference queue.

Auxiliary requests reuse the main model executor and collect ordinary output text rather than buffering all provider events. This removes the independent idle timeout and cumulative event-size cap while preserving usage/cancellation custody. Existing title/recap regressions have also been exercised.

Synced with rust-preview through 750eca369, including upstream removal of planning mode and the revised CI/test setup.

Verification

The feature keeps a few focused cases by extending existing fixtures and lifecycle tests:

  • The real Bot/Host HTTP integration checks SendUser → sleep → prediction → next user message, exact prefix/options reuse, unchanged outbox/conversation events, default Bot support, and exclusion when the new switch is on. Model responses are fixtures.
  • The existing delegation test completes a real Agent-created worker and verifies predictions are rejected before model dispatch even with the scope switch off.
  • Settings persistence verifies the scope switch and fractional percentages survive reopening the store.
  • The real GPUI/WGPU desktop case operates the new switch, saves it, and checks regular-root prediction, original provider prefix/options, undoable draft insertion, and no automatic send. It runs in light/dark × wide/narrow windows.
  • The existing stale-result case covers cancellation/draining and replacement by the next source.
  • just fmt-check, just lint, just typecheck, just test-js (180 tests), just licenses, and strict Clippy for the desktop integration target pass. Focused Rust runs pass: 2 Bot/delegation cases, settings reopening, 9 component regressions, and the desktop prediction case in all four visual configurations.

The history assertion checks session-scoped canonical events. observe.through is partition-wide and can legitimately advance due to auxiliary usage accounting, so equality of that cursor is not a valid no-chat-write assertion. The focused side-pane draft-isolation test replaces the earlier intermittent multi-pane/resize scenario. Obsolete pixel/TMPDIR checks removed upstream were not restored.

Full workspace Rust tests were not run locally; the focused checks above do not claim a complete workspace test pass.

Actual desktop renderer captures (fixture conversation; scope switch enabled):

Inline composer suggestion

General prediction settings table

AI use

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: OpenAI Codex implemented the feature, localized copy, and tests. ChatGPT desktop behavior and its observed default instructions informed the reconstruction. AI-authored commits include a Generated-by: Codex trailer.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

@M4n5ter
M4n5ter force-pushed the feat/composer-predictions branch 2 times, most recently from c91e7e2 to 8bddfe3 Compare November 2, 2026 07:54
@M4n5ter
M4n5ter force-pushed the feat/composer-predictions branch from 90f2460 to 2e683f6 Compare November 2, 2026 09:29
@M4n5ter
M4n5ter merged commit 81dd0b3 into rust-preview Nov 2, 2026
2 checks passed
@M4n5ter
M4n5ter deleted the feat/composer-predictions branch November 2, 2026 09:36
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