Repository navigation
feat(chat): edit the final user message - #7237
ipanasenko wants to merge 9 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
One finding: invariant documentation was dropped while moving shared eligibility helpers out of apps/server/src/orchestration/decider.ts into packages/contracts/src/messageCorrection.ts. Everything else in the changed Effect code (namespace subpath imports, Context.Service/make/layer shapes, dependency acquisition, no new ManagedRuntime/runPromise outside tests, error construction at the failure boundary) looks consistent with the conventions.
Posted via Macroscope — Effect Service Conventions
There was a problem hiding this comment.
Reviewed the web UI changes (MessagesTimeline.tsx, ChatView.tsx) for shared-primitive usage, Tailwind ownership, and theming/layout preservation. The new edit action correctly reuses Button/Tooltip/Textarea and mirrors the existing RevertUserMessageButton composition. Two findings on the new inline editor: a viewport-relative min-width that can overflow a narrow chat column, and a surface/foreground token pairing that can lose contrast under custom themes.
Posted via Macroscope — UI Consistency
There was a problem hiding this comment.
One finding on the new inline message editor inside the user message bubble. The shared primitives (Textarea, Button) are used correctly and the Edit affordance mirrors RevertUserMessageButton; the only issue is the ghost Cancel button's hover state on the message surface.
Posted via Macroscope — UI Consistency
There was a problem hiding this comment.
One inline-editor consistency finding on the new message-edit surface in apps/web/src/components/chat/MessagesTimeline.tsx. The rest of the web changes (Button/Textarea primitive usage, ghost Cancel hover treatment, edited-metadata row, and the Revert/Edit mutual exclusion driven by revertTurnCountByUserMessageId) look consistent with the existing chat timeline patterns.
Posted via Macroscope — UI Consistency
There was a problem hiding this comment.
One finding in the new inline message editor: the editor textarea has no height cap, so it can grow past the viewport for the long user messages this row otherwise collapses.
Posted via Macroscope — UI Consistency
Keep the message-correction event as its own union member, project the correction columns, and match the current thread snapshot/command shape so the edit-final-message work compiles on personal. Co-authored-by: Cursor <[email protected]>
|
Note 🤖 GPT-5.6 Sol responding on behalf of Theo Closing this PR after an automated pass over open pull requests. Unfinished message-editing draft spans 51 files and its database migration now conflicts with main. |
Ports the fork's edit-the-final-message feature (PR pingdotgg#7237, dropped with the old engine) onto upstream primitives instead of a server command: - The last user message the user typed gets an Edit action (when its run has a rollback checkpoint, disabled while the thread works) that opens an inline editor in the bubble. Only the typed text is editable; the Ultrathink prefix and structured context blocks are kept. - Send rolls the thread back to before the message with checkpoint.rollback (restoreFiles: false, so it also works in shared workspaces), shows the edited text in the bubble meanwhile, then sends the edited message with the original attachments and context. If the send fails after the rollback, the text returns to the composer. - Upstream's "Edit from here" (rewind into the composer) is unchanged. Guard: require lines pin the ChatView wiring, the files-kept rollback, and the timeline's Edit button and inline editor. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Users could not correct a thread-ending prompt after the thread became idle without sending a separate follow-up.
This adds a first-class message-correction command and event across contracts, server orchestration, projections, persistence, relay snapshots, and both web and mobile clients. Edit is offered only when the final visible message is the user message and the thread is idle. Corrections preserve structured context, reject stale edits, start a normal replacement turn, remain consistent through pagination and server restarts, and reconcile correctly when checkpoints are reverted.
Implemented with gpt-5.6-sol via Codex in T3 Code.