Skip to content

fix(slack): stop false fallback warnings and surface preamble text during tool turns#278

Merged
Aaronontheweb merged 1 commit into
devfrom
fix/slack-fallback-and-preamble
Mar 18, 2026
Merged

fix(slack): stop false fallback warnings and surface preamble text during tool turns#278
Aaronontheweb merged 1 commit into
devfrom
fix/slack-fallback-and-preamble

Conversation

@Aaronontheweb

Copy link
Copy Markdown
Collaborator

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 _postedThisTurn was not set after flushing the buffer on TurnCompleted.

  • 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 BufferFlush lifecycle signal emitted from HandleToolCallResponse that tells streaming adapters to flush their accumulated buffer before tool execution begins.

How BufferFlush works

  1. LLM returns text + tool calls in a single response
  2. HandleToolCallResponse emits TextOutput (for non-streaming path) + BufferFlush (for streaming path)
  3. Slack adapter: if streaming deltas accumulated, BufferFlush flushes them to Slack immediately. If no streaming happened, the TextOutput posts directly via existing guard.
  4. Buffer is cleared and ready for the next tool iteration's output

Files changed

File Change
SessionOutput.cs Add BufferFlush lifecycle record
SessionOutputDtoMapper.cs DTO mapping for CLI/SignalR
LlmSessionActor.cs Emit TextOutput + BufferFlush in HandleToolCallResponse
SlackThreadBindingActor.cs Fix _postedThisTurn tracking; add BufferFlush handler
ReminderExecutionActor.cs No-op BufferFlush handler

Test plan

  • Preamble_text_surfaces_before_tool_calls — verifies TextOutput + BufferFlush arrive before ToolCallOutput
  • BufferFlush_roundtrips_through_dto — verifies DTO serialization roundtrip
  • All 913 existing tests pass with zero regressions

…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.
@Aaronontheweb Aaronontheweb marked this pull request as ready for review March 18, 2026 03:27
@Aaronontheweb Aaronontheweb merged commit 8ec5d29 into dev Mar 18, 2026
3 checks passed
@Aaronontheweb Aaronontheweb deleted the fix/slack-fallback-and-preamble branch March 18, 2026 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slack long-running turns have weak progress UX and can emit misleading no-reply fallbacks

1 participant