Repository navigation
Conversation
Winoren
force-pushed
the
fix/restore-first-attachment-draft
branch
from
November 23, 2026 15:47
8b1a0eb to
703ab7e
Compare
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.
Description
The create-chat page consumes the first question before its local attachments can be uploaded to the newly created session. If that deferred upload is rejected, the send path returned after showing the error, leaving an empty session and no editable draft.
Restore the consumed draft in that failure branch. Cleaned-up temporary document IDs are removed, each rejected attachment is shown in the existing failed/removable state, and the question, images, and attachments are put back into the mounted composer. Existing-session upload behavior and successful first-message sends are unchanged.
Prepared and verified with Codex assistance.
Type of Change
Related Issue
Fixes #5876
Testing
node --import tsx --test src/components/Input-field.prefill.test.ts src/views/chat/sessionLoad.test.ts src/views/chat/firstMessageDraft.test.ts— 28 tests passed.node --max-old-space-size=4096 ./node_modules/vue-tsc/bin/vue-tsc.js --build— passed.git diff --cached --check— passed.The new regression verifies that a rejected deferred upload clears its rolled-back temporary document ID, becomes a visible failed attachment, and restores the question, image, and attachment to the composer. The full frontend test suite and production deployment were not run.
Checklist
git diff --check origin/main...HEADpassesScreenshots / Recordings
Not applicable; failure-state draft restoration.