fix(slack): stop false fallback warnings and surface preamble text during tool turns#278
Merged
Merged
Conversation
…ring tool turns (#277) Fix two Slack UX bugs: 1. The Slack adapter posted "I didn't manage to produce a reply" even after real streamed text was delivered, because _postedThisTurn was not set after flushing the buffer on TurnCompleted. 2. When the model produced text alongside tool calls (e.g., "Let me search for that..."), the preamble sat invisible in the buffer until all tool iterations completed. Introduce a BufferFlush lifecycle signal emitted from HandleToolCallResponse that tells streaming adapters to flush their accumulated buffer before tool execution begins.
This was referenced Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #277 — the two most impactful Slack UX bugs:
False fallback warning after real content: The Slack adapter posted ":warning: I didn't manage to produce a reply" even after real streamed text was delivered, because
_postedThisTurnwas not set after flushing the buffer onTurnCompleted.Invisible preamble during tool turns: When the model produced text alongside tool calls (e.g., "Let me search for that..."), the preamble sat invisible in the buffer until all tool iterations completed. Introduces a
BufferFlushlifecycle signal emitted fromHandleToolCallResponsethat tells streaming adapters to flush their accumulated buffer before tool execution begins.How BufferFlush works
HandleToolCallResponseemitsTextOutput(for non-streaming path) +BufferFlush(for streaming path)BufferFlushflushes them to Slack immediately. If no streaming happened, theTextOutputposts directly via existing guard.Files changed
SessionOutput.csBufferFlushlifecycle recordSessionOutputDtoMapper.csLlmSessionActor.csHandleToolCallResponseSlackThreadBindingActor.cs_postedThisTurntracking; add BufferFlush handlerReminderExecutionActor.csTest plan
Preamble_text_surfaces_before_tool_calls— verifies TextOutput + BufferFlush arrive before ToolCallOutputBufferFlush_roundtrips_through_dto— verifies DTO serialization roundtrip