← Back to PRs

#18187: fix: tool summaries silently dropped when reasoningLevel is stream

by ayanesakura open 2026-02-16 15:49 View on GitHub →
docs channel: discord channel: telegram agents stale size: M
## Problem When `reasoningLevel` is set to `"stream"`, all successful tool summary messages (e.g. `🔧 Exec: ...`) are silently dropped and never delivered to the user. Failed tool messages (with ⚠️) are unaffected. ## Root Cause In `agent-runner-execution.ts`, the `onToolResult` callback uses `normalizeStreamingText()` to process tool summaries. This function checks `allowPartialStream`, which is `false` when `reasoningLevel === "stream"` and `onReasoningStream` is present: ```typescript const allowPartialStream = !( params.followupRun.run.reasoningLevel === "stream" && params.opts?.onReasoningStream ); ``` When `allowPartialStream` is false, `normalizeStreamingText` returns `{ skip: true }` immediately, causing all tool summaries to be discarded. ## Fix Bypass `normalizeStreamingText` in the `onToolResult` callback and apply only the lightweight sanitization that tool summaries actually need (`isSilentReplyText` check + `sanitizeUserFacingText`). Tool summaries are not streaming text and should not be gated by `allowPartialStream`. ## Testing - Verified tool summaries now appear in Telegram when `reasoningLevel: stream` - Failed tool messages continue to work as before - No impact on partial streaming text behavior <!-- greptile_comment --> <h3>Greptile Summary</h3> This PR fixes tool summaries being silently dropped when `reasoningLevel` is `"stream"` by bypassing `normalizeStreamingText` in the `onToolResult` callback. The fix correctly applies only the lightweight sanitization needed for tool summaries (`isSilentReplyText` check and `sanitizeUserFacingText`) instead of the full streaming text normalization. However, this PR bundles multiple unrelated features beyond the stated fix: - Telegram reasoning buffer to send reasoning before main text - Discord proxy support for media downloads (`channels.discord.proxy`) - Reply dispatcher timeout mechanism (30s default) - Groq audio transcription curl fallback for 403 errors - Discord handler refactoring and type improvements The core tool summary fix is sound, but bundling multiple features in a single PR makes review, testing, and potential rollback more difficult. Consider splitting these into separate PRs in the future. <h3>Confidence Score: 4/5</h3> - This PR is reasonably safe to merge with moderate risk from scope creep - The core fix for tool summaries is correct and well-reasoned. However, the PR bundles multiple unrelated features (Telegram reasoning buffer, Discord proxy, reply timeout, Groq fallback) which increases complexity and testing surface area. The changes are well-implemented individually but would benefit from being split into separate PRs. Previous review threads identified issues that have not been addressed in this PR. - Pay close attention to `src/auto-reply/reply/reply-dispatcher.ts` (timeout implementation) and `src/telegram/bot-message-dispatch.ts` (reasoning buffer logic) <sub>Last reviewed commit: edc7b33</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs