feat(ai-chat): прервать агента и отправить отложенное сообщение сейчас (#198) #203
Closed
Ghost
wants to merge 2 commits from
feat/198-interrupt-agent-send-now into develop
pull from: feat/198-interrupt-agent-send-now
merge into: vvzvlad:develop
vvzvlad:main
vvzvlad:test/244-part-b
vvzvlad:fix/255-ws-redis-adapter-leak
vvzvlad:feat/251-intentional-clear
vvzvlad:fix/252-e2e-open-handles
vvzvlad:feat/184-autonomous-agent-runs
vvzvlad:feat/221-image-captions
vvzvlad:feat/git-sync
vvzvlad:refactor/193-tool-spec-registry
vvzvlad:fix/244-dataloss-bugs
vvzvlad:fix/embeddings-reindex-progress
vvzvlad:develop
vvzvlad:feature/offline-sync
vvzvlad:feat/229-catalog-yaml
vvzvlad:feat/243-blob-sandbox
vvzvlad:feat/228-inline-footnotes
vvzvlad:fix/qa-ui-bugs-216-218
vvzvlad:feature/agent-roles-catalog
vvzvlad:fix/share-alias-rename
vvzvlad:fix/ai-chat-empty-render
vvzvlad:feat/191-chat-doc-binding
vvzvlad:feat/201-temporary-notes
vvzvlad:feat/198-interrupt-agent
vvzvlad:feat/ai-chat-full-history
vvzvlad:feat/199-ai-generate-title
vvzvlad:feat/205-share-aliases
vvzvlad:batch/issues-189-187-170
vvzvlad:feat/170-mcp-test-button
vvzvlad:feat/189-context-badge
vvzvlad:fix/issues-190-159
vvzvlad:fix/ai-chat-new-chat-during-stream
vvzvlad:fix/ai-chat-stream-perf
vvzvlad:batch/issues-2026-06-25
vvzvlad:feat/ai-chat-persistent-history
vvzvlad:fix/ai-chat-copy-chat-wysiwyg
vvzvlad:fix/ai-stream-reset-resilience
vvzvlad:fix/ai-stream-undici-timeout
vvzvlad:fix/footnote-review-1227-followup
vvzvlad:fix/ai-chat-token-counter-realtime
vvzvlad:docs/manual-qa-test-plan
2 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
5b146fd24d |
fix(ai-chat): branch sendNow on live status and fix stale queue comment
Address review on #198 (interrupt agent / send now): - sendNow now branches on the live useChat status (statusRef) instead of the closure-captured isStreaming. A turn can finish between render and click, where stop() is a no-op; arming flushOnAbortRef/interruptNextSendRef against that no-op would strand the flags and leak into a later, unrelated Stop (auto-sending a queued message the user did not ask to send). - Correct the stale queue comment: onFinish DOES fire on Stop/disconnect/ error (its abort/disconnect/error branches leave the queue intact), and a deliberate "Send now" flushes the promoted head via the abort branch. i18n keys for "Send now"/"Interrupt and send now" were already registered in en-US and ru-RU on this branch. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|
|
f789be9c89 |
feat(ai-chat): interrupt agent and send a queued message now (#198)
Add a "Send now" button to each queued AI-chat message that interrupts the running agent and immediately resends that message, preserving the agent's partial output and telling it on the next turn that it was interrupted. Client: - queue-helpers: new pure promoteToHead() (+ tests) - chat-thread: sendNow() promotes the chosen message to the queue head and aborts; onFinish flushes the promoted head on the intentional abort; a one-shot `interrupted` flag rides that resend request; stale flags are cleared at every turn start to defuse a clean-finish/click race leak - "Send now" action icon + en-US/ru-RU translations Server: - AiChatStreamBody.interrupted flag; shouldInjectInterruptNote() gates on the flag AND a genuinely-unfinished previous turn (aborted/streaming) - buildSystemPrompt() appends INTERRUPT_NOTE inside the safety sandwich so the model treats its previous, partial reply as incomplete - prompt + service unit tests Partial-output persistence already existed (onAbort -> 'aborted', findRecent replays regardless of status); that path is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |