Comfy-Org / Comfy-Org/ComfyUI_frontend

fix(agent): preserve composer draft and attachments when send fails

Open
#16,513 0 comments 0 reactions 1 assignee Claimed by @christian-byrne View on GitHub
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

- A failed message POST currently clears the Pinia-backed prompt and attachment basket before the result is known.
- Preserve the exact draft and attachments until `sendMessage` reports acceptance; on failure, leave them available for retry.
- Cover text-only and attachment sends, including ownership of any `blob:` preview URLs.

Exact-head evidence and acceptance criteria

Verified on `origin/main@95d4c7bf4cc5fbb27643e737c31c66e42bc53992`.

`useComposer.ts:29-37` invokes a synchronous `onSend` callback and immediately clears the shared `draft` and `attachments`. `AgentPanelRoot.vue:626-634` fire-and-forgets `sendMessage`, while `useAgentSession.ts:171-249` returns `false` when the POST fails. That result cannot reach the composer, so transient failures destructively discard user input. Failed-send transcript entries retain the text only; submitted attachment previews are neither restored to the basket nor transferred to the failed entry.

Acceptance criteria:

- The composer clears only after the message POST is accepted.
- A rejected or failed POST preserves the exact prompt and attachments for retry.
- Attachment preview ownership is explicit and no `blob:` URL is orphaned.
- Regression coverage includes text-only and attachment failure paths.

Independent verification: OPP-56 second pass reproduced the same call chain from a fresh read at the exact head. Open-issue searches found no matching tracker; #16386 is a broad historical routing tracker and does not describe this defect.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.