* fix(cancel): preserve partial streamed response on Stop Generation (#893) * docs(cancel): fix misleading comment — partial message is NOT _error=True The outer comment block claimed `_error=True so _sanitize_messages_for_api() strips it from future conversation history`, but the actual append call sets only `_partial=True` (correctly matching the inner comment six lines below and the PR description). Updated the outer comment to match reality so a future reader doesn't try to "fix" the code to match the wrong comment. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: nesquena-hermes <nesquena-hermes@users.noreply.github.com> Co-authored-by: Nathan Esquenazi <nesquena@gmail.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1662,6 +1662,7 @@ STREAMS: dict = {}
|
||||
STREAMS_LOCK = threading.Lock()
|
||||
CANCEL_FLAGS: dict = {}
|
||||
AGENT_INSTANCES: dict = {} # stream_id -> AIAgent instance for interrupt propagation
|
||||
STREAM_PARTIAL_TEXT: dict = {} # stream_id -> partial assistant text accumulated during streaming
|
||||
SERVER_START_TIME = time.time()
|
||||
|
||||
# ── Thread-local env context ─────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user