Repository navigation
Description
P2 · Reproduced locally at 44e0dcf254975286c0e9dea443b5cd1ca6b23347.
An ordinary connection failure silently removes an uploaded file from the retry draft.
Reproduction:
- Open a fresh chat, stage a file, and type a message.
- Make the initial POST /api/app/chat/threads fail before it creates the thread, for example by losing connectivity at Send.
- Wait for the send failure and inspect the retry draft.
Expected: A failure before any thread or message was created restores both the unsent text and the staged file for retry.
Observed: The text returns to the composer, but the file chip is gone and staged attachments remain empty. Retrying sends only the restored text unless the person notices and reattaches the file.
Cause: handleSend takes the staged attachments before awaiting chatSend.start. Its outer catch restores text and video jobs but omits setStagedAttachments(consumedAttachments). The later outcome-rejection path does restore them.
Frozen observation/control output:
CONFIRMED early create-thread transport rejection: text restored; staged attachments=0; send adapter used=true
CONTROL existing-thread message rejection: text and registered attachment restored; request attachments=1
Control: With the same text and registered local attachment, failure of the message request on an existing thread restores both text and file. Only failure before chatSend.start resolves loses the file.
Exact probe command:
/Users/yannick/.npm/_npx/22f2fe8d8bc13000/node_modules/.bin/bun x vitest run --config /Users/yannick/.codex/notes/tale-100-findings/project-chat-proof/vitest.config.ts /Users/yannick/.codex/notes/tale-100-findings/project-chat-proof/chat-boundaries.probe.test.tsx --maxWorkers 2 --reporter verbose --silent=falseProof boundary: Executed actual ChatSurface, Composer, useChatSend, createChatThread, backendFetch and sendChatTurn. Transport rejection was controlled at fetch; reads and the upload hook’s already-staged state were test seams. The file was separately uploaded and registered through the local API, and the existing-thread control verifies the real send adapter forwards it. No browser, production, or external-provider call.
Source:
- services/platform/app/features/chat/components/chat-surface.tsx:1198
- services/platform/app/features/chat/components/chat-surface.tsx:1396
- services/platform/app/features/chat/data/chat-backend.ts:863
Deduplication: Cached all-state titles and current findings reviewed. Parent checked #725: a historical generic attachment-send failure with no recovery/draft-loss root. #2663 is the shared-chat fork dropping attachments; #3558 is an Inbox upload failure. This is the direct chat create-thread rejection path.
Independent verification
The parent independently reran all five chat observations and controls, including the real local edit/regenerate HTTP persistence path: 5 passed, exit 0 (project-chat-proof/parent-chat-confirmed.log). The first combined run hit 5-second time limits under concurrent load; the isolated rerun used one worker and a 30-second per-test limit. No source or assertions were changed. The local deterministic model was the only provider involved.
Activity