Comfy-Org / Comfy-Org/ComfyUI_frontend

fix(agent): route Enter through the pending-submit guard

Open
#16,514 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

- While the first message POST is pending, clicking the primary button follows the stop/guard path but pressing Enter submits again.
- The second submit is rejected as busy after `useComposer` has already cleared the newly typed draft.
- Route keyboard and button activation through one running-state action and add the missing Enter regression test.

Exact-head evidence and acceptance criteria

Verified on `origin/main@95d4c7bf4cc5fbb27643e737c31c66e42bc53992`.

`Composer.vue:288-303` computes `running = streaming || submitting`, and `onPrimaryAction` emits `stop` while running. `onEnter`, however, calls `composer.submit()` directly. `useComposer.ts:29-37` checks only `isStreaming`, so during the initial pending POST Enter emits a second send and clears the second draft. `useAgentSession.ts:176-182` rejects that request as busy. Existing component tests cover the button during `submitting`, not Enter.

Acceptance criteria:

- Enter and the primary button use the same running-state action.
- A pending submit cannot emit a second send or clear a newly typed draft.
- A regression test presses Enter while `submitting=true` and asserts no send and no draft loss.

Independent verification: OPP-56 second pass reproduced the same path from a fresh read at the exact head. Open-issue searches found no matching tracker; #16386 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.