Skip to content

[feat] canvas: queue a message sent while a reply runs - #383

Open
wtz2333 wants to merge 1 commit into
ThinkFlowLab:mainfrom
wtz2333:feat/midturn-queue-composer
Open

wtz2333 wants to merge 1 commit into
ThinkFlowLab:mainfrom
wtz2333:feat/midturn-queue-composer

Conversation

@wtz2333

@wtz2333 wtz2333 commented Nov 17, 2026

Copy link
Copy Markdown

Summary

  • The composer no longer swaps Send for Stop while a reply runs. Both stay: the reply can still be stopped, and the draft can still be submitted, which hands it to POST /assistant/messages — 202 { queued } goes into the log as a queued bubble with its position, and an idle project streams its reply as before.
  • One stream now covers the whole chain: each start frame opens a new reply, an end frame carrying nextTurnId means the next queued message already began, and the final end closes the view. Stop follows the chain by tracking nextTurnId, so it stops the reply that is actually running.
  • A message that was queued and then cancelled by Stop stays visible as cancelled instead of disappearing.
  • New copy ships in both locales: queue button label and title, the queued bubble, the cancelled bubble, and the hint under the composer while typing during a run.

Depends on #381, which adds POST /assistant/messages: the endpoint is not on main yet, so this branch builds and its tests pass on its own, but the browser journeys need that backend to run. Please land #381 first.

Linked issue

Refs #379 (the same issue as #381; it stays open for runtime-native steering).

  • Refs #379 is included

Labels

  • Not applied: wtz2333 cannot add labels here (GitHub refuses AddLabelsToLabelable). Suggested: type:feat, area:canvas, area:agent.

Test plan

  • Local:
    • node --test tests/*.test.ts → 834 passed, including the new tests/assistantQueue.test.ts, which covers both answers of the endpoint (202 queued, 200 stream) and a stream that carries two replies.
    • node scripts/check-i18n.mjs → 3038 keys, 0 problems, Chinese source lines still under the baseline.
    • tsc --noEmit → clean. vite build → built.
  • Left to CI: the browser journeys (assistant_run_navigation, assistant_sessions, assistant_auxiliary_panels, default_entry, kimi_real) — they need the isolated API and Vite, and [feat] assistant: accept a follow-up message while a turn is still running / 运行中插入补充消息 #379's endpoint to be present, so they run against the merged combination.

Evidence that it works

  • Media attached, or N/A because: the browser journeys cover the composer; no recording was made in this environment (no isolated API + browsers here). The two endpoint paths are covered by unit tests.

Provider verification

  • Real-provider calls are described honestly, or none were made: none; the tests replace fetch.

Bilingual UI

  • Both locales are updated: zh-CN and en-US both gain assistant.panel.queue, queueHint, queued, queueWhileRunning and cancelled.

While a reply streams, the composer kept the draft but replaced Send with
Stop and Enter returned without a word, so a supplement could only be
typed in and lost. It is sent now: the server answers 202 with the queued
message, the log shows it as queued, and the same stream keeps feeding the
replies that follow until the chain ends.

Refs ThinkFlowLab#379
@github-actions github-actions Bot added area:agent Agent runtime, assistant chat and tools area:canvas Canvas, nodes and direct manipulation type:feat New capability or behaviour labels Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agent Agent runtime, assistant chat and tools area:canvas Canvas, nodes and direct manipulation type:feat New capability or behaviour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant