Repository navigation
Conversation
This was referenced Nov 5, 2026
This branch has not been deployed
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.
Problem
Part of #30850: editing an already-sent message through Edit from here loses its thread mention. On current main (
9e85538535), the reference is removed entirely:Wait for @Mention baseline target to mergereturns asWait for to merge.Reproduction on the macOS web dev client:
@picker and send the message.The dashed unavailable-chip symptom in the issue is reproduced by queued-message editing. That separate path is covered by #30874 and #30889; this PR does not close the issue or duplicate their changes.
Change
Preserve thread references when restoring a sent message after rewind, and restore its saved thread context records into the composer draft with
appendReference: false. This retains the original environment/thread identity and allows resend to carry the metadata without adding duplicate references.Ordinary up-arrow prompt-history recall keeps its existing behavior. References with no backing record remain unresolved rather than receiving invented metadata. A deleted thread retains its saved title and the existing “Thread no longer available” guidance.
Scope and approval
This is a small, focused fix for an obvious data-loss bug in the existing sent-message edit workflow. It changes only the shared web/desktop rewind path, its prompt helper, and focused regression tests. It adds no feature, setting, product default, contract or provider behavior.
The independent queued-edit fixes in #30874 and #30889 touch different files. Machine/environment mention loss during sent-message editing is a pre-existing gap and remains outside this PR's scope.
Verification
vp test run apps/web/src/components/chat/chatViewSend.test.ts apps/web/src/components/chat/composerPromptHistory.test.ts— 20 tests passed in 2 files. Coverage includes restoration into an existing draft, failed rewind leaving the draft untouched, preserved context on save/re-edit, missing records, and unchanged ordinary history recall.vp run check:changed— format, lint, knip, affected typechecks, focused tests and React compiler checks passed.git diff --check— passed..t3state and free Replay (dev) turns: Cancel leaves the sent message and draft unchanged; rewind, resend and a second edit retain the resolved thread chip. A read-only database check confirmed exactly one saved thread context record on resent messages. Deleting only the disposable target fixture retained its title and showed “Thread no longer available”.The before image below was recaptured from a clean source tree at upstream main
9e85538535c8553901351112ab02dd1dd62db5ee, with zero tracked or untracked source changes. The after image shows the same fixture flow with this patch. Screenshots and the interaction video were inspected for privacy; only disposable fixture content is visible.Interaction video: Cancel, rewind, resend and re-edit
Limitations: the packaged Electron app was not run; it shares this web code. Native mobile has no sent-message rewind path and was not changed or tested. Relay/tunnel modes were not separately exercised. Queued edits and machine/environment mentions are not fixed here.
Implemented with GPT-6.1 Sol through the Codex harness in T3 Code. Independently reviewed with Claude Code Opus 5.5 High.