qwen-code/packages/web-shell/client/hooks
ytahdn 554c5e44ba
feat(web-shell): support mutable default mid-turn messages (#8229)
* feat(web-shell): support mutable default mid-turn messages

* fix(serve): register mid-turn removal telemetry route

* test(serve): update telemetry route totals

* fix(test): add session_mid_turn_message_mutation to expected features list

* fix(webui): forward clientId on cross-session mid-turn removal (#8229)

- Forward the session clientId in the cross-session removeMidTurnMessage
  branch so the bridge's exact-originator match can succeed; without it the
  removal resolved to an undefined originator and could never remove the
  message stamped at enqueue.
- Strip a misaligned/malformed messageIds from mid_turn_message_injected in
  asKnownDaemonEvent instead of rejecting the whole event, mirroring the
  sidechannel parser so a buggy daemon can't silently lose the injection
  signal.
- Log a mid-turn removal miss in the bridge like the enqueue/pending-removal
  siblings, to make removal races diagnosable from daemon logs.

* fix(web-shell): exclude annotations from mid-turn path and harden idle cleanup (#8229)

* fix(web-shell): add container-type to .queuedPrompts so @container query applies (#8229)

* fix(web-shell): harden mid-turn dedupe and capability gate per review (#8229)

- removeInjectedFromQueue now matches by id first (position-independent)
  and falls back to text only when no id match exists, so two same-text
  sends can't remove the wrong row and double-deliver.
- Thread canMutateMidTurn into useQueuedPrompts and gate the mid-turn
  delete/edit mutation on it, so the keyboard path can't hit a DELETE
  route the daemon doesn't advertise.
- asMidTurnMessageInjectedData omits a malformed messageIds key instead
  of leaving a present undefined, matching the sidechannel parser.
- Narrow MidTurnQueueItem.midTurnState, document the load-bearing effect
  order, and make clearQueuedPrompts return false on a no-op clear.

* fix: harden mid-turn removal per review (log escape, cross-session client id) (#8229)

- Escape the caller-controlled messageId (and sessionId) in the mid-turn
  removal-miss stderr line to prevent log injection (CWE-117).
- Forward the target session's persisted client id on cross-session mid-turn
  removal so the bridge's exact-originator match no longer rejects valid
  removals after a session switch with per-session client ids.
- Strengthen tests: distinct-id independence for two queued messages, deferred
  removal proving the composer waits for daemon removal, and the active-turn
  delete failed-action flag.

---------

Co-authored-by: 钉萁 <dingqi.jww@alibaba-inc.com>
Co-authored-by: Shaojin Wen <shaojin.wensj@alibaba-inc.com>
Co-authored-by: Qwen Code Autofix <qwen-code-autofix@users.noreply.github.com>
Co-authored-by: Qwen Code Bot <qwen-code-bot@users.noreply.github.com>
2026-08-01 10:41:29 +00:00
..
daemonSessionMappers.ts feat(daemon): merge daemon-mode feature batch into main (#4490) 2026-06-12 00:34:49 +08:00
useAnimationFrameTranscriptBlocks.test.tsx fix(web-shell): reduce composer input latency (#8015) 2026-07-29 08:06:53 +00:00
useAnimationFrameTranscriptBlocks.ts fix(web-shell): reduce composer input latency (#8015) 2026-07-29 08:06:53 +00:00
useAnimationFrameValue.ts feat(daemon): merge daemon-mode feature batch into main (#4490) 2026-06-12 00:34:49 +08:00
useAtMentionMenu.test.tsx fix(web-shell): reduce composer input latency (#8015) 2026-07-29 08:06:53 +00:00
useAtMentionMenu.ts fix(web-shell): reduce composer input latency (#8015) 2026-07-29 08:06:53 +00:00
useBackgroundTasks.test.tsx fix(web-shell): quiet background task polling failures (#7923) 2026-08-01 02:04:06 +00:00
useBackgroundTasks.ts fix(web-shell): quiet background task polling failures (#7923) 2026-08-01 02:04:06 +00:00
useComposerCore.dom.test.tsx fix(web-shell): keep pasted text visible (#8230) 2026-07-31 15:39:10 +00:00
useComposerCore.mobile.dom.test.tsx fix(web-shell): reduce composer input latency (#8015) 2026-07-29 08:06:53 +00:00
useComposerCore.test.ts fix(web-shell): keep pasted text visible (#8230) 2026-07-31 15:39:10 +00:00
useComposerCore.ts fix(web-shell): keep pasted text visible (#8230) 2026-07-31 15:39:10 +00:00
useDelayedGlobalKeyDown.ts feat(daemon): merge daemon-mode feature batch into main (#4490) 2026-06-12 00:34:49 +08:00
useFilterInput.test.tsx feat(web-shell): overhaul list-dialog interaction, keyboard nav & a11y (#6128) 2026-07-02 12:19:17 +00:00
useFilterInput.ts feat(web-shell): overhaul list-dialog interaction, keyboard nav & a11y (#6128) 2026-07-02 12:19:17 +00:00
useInputHistory.ts fix(web-shell): isolate history and session drafts (#7810) 2026-07-28 01:45:52 +00:00
useIsLargeScreen.test.tsx feat(tui): Ctrl+O frozen transcript view and unified tool output rendering (#5666) 2026-07-09 23:40:29 +00:00
useIsLargeScreen.ts feat(tui): Ctrl+O frozen transcript view and unified tool output rendering (#5666) 2026-07-09 23:40:29 +00:00
useIsTouchComposer.test.tsx fix(web-shell): render a plain textarea composer on touch devices (#7587) 2026-07-23 13:14:25 +00:00
useIsTouchComposer.ts fix(web-shell): render a plain textarea composer on touch devices (#7587) 2026-07-23 13:14:25 +00:00
useListboxKeyboard.test.tsx feat(web-shell): overhaul list-dialog interaction, keyboard nav & a11y (#6128) 2026-07-02 12:19:17 +00:00
useListboxKeyboard.ts feat(web-shell): overhaul list-dialog interaction, keyboard nav & a11y (#6128) 2026-07-02 12:19:17 +00:00
useMessages.test.ts fix(web-shell): sync background agent status (#7561) 2026-07-23 06:35:04 +00:00
useMessages.ts fix(web-shell): reduce composer input latency (#8015) 2026-07-29 08:06:53 +00:00
useNewSessionSuggestion.test.tsx fix(web-shell): reduce composer input latency (#8015) 2026-07-29 08:06:53 +00:00
useNewSessionSuggestion.ts fix(web-shell): reduce composer input latency (#8015) 2026-07-29 08:06:53 +00:00
useOtherWorkspaceSessions.test.tsx fix(web-shell): filter sessions by source (#6995) 2026-07-16 04:56:50 +00:00
useOtherWorkspaceSessions.ts docs(serve): Close multi-workspace hardening gaps (#7019) 2026-07-16 17:33:53 +00:00
usePrefersReducedMotion.test.tsx feat(web-shell): enhance composer and empty-session animations (#8098) 2026-07-31 02:20:27 +00:00
usePrefersReducedMotion.ts feat(web-shell): enhance composer and empty-session animations (#8098) 2026-07-31 02:20:27 +00:00
useQueuedPrompts.dom.test.tsx feat(web-shell): support mutable default mid-turn messages (#8229) 2026-08-01 10:41:29 +00:00
useQueuedPrompts.test.ts fix(web-shell): stop stacking duplicate copies when restoring prompt text (#7134) 2026-07-17 22:22:50 +00:00
useQueuedPrompts.ts feat(web-shell): support mutable default mid-turn messages (#8229) 2026-08-01 10:41:29 +00:00
useScopedSessions.test.tsx fix(web-shell): filter sessions by source (#6995) 2026-07-16 04:56:50 +00:00
useScopedSessions.ts fix(web-shell): filter sessions by source (#6995) 2026-07-16 04:56:50 +00:00
useSessionArtifacts.test.tsx feat(web-shell): add artifact right panel (#6591) 2026-07-11 00:13:49 +00:00
useSessionArtifacts.ts fix(web-shell): polish embedded shell interactions (#7477) 2026-07-22 05:21:50 +00:00
useShallowMemo.ts feat(daemon): merge daemon-mode feature batch into main (#4490) 2026-06-12 00:34:49 +08:00
useSharedNow.ts refactor(web-shell): restructure chat UI (#5775) 2026-06-23 22:43:19 +08:00
useStreamingLoadingMetrics.ts fix(ui): display output tokens instead of cumulative API throughput for subagents (#5972) 2026-06-29 07:27:41 +00:00