fix(telegram): gate reasoning previews to stream sessions#61266
fix(telegram): gate reasoning previews to stream sessions#61266vincentkoc merged 2 commits intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR fixes a bug in the Telegram integration where a reasoning preview lane was incorrectly allocated for any session with answer preview streaming enabled — not just those explicitly set to Key changes:
Confidence Score: 4/5Safe to merge — the fix is minimal, correct, and well-tested with a direct regression assertion. One-line logic fix with a targeted regression test. The downstream callback guard at line 773 was already correct; this aligns the lane creation condition with it. No edge cases for explicit reasoning:stream sessions are affected. Score is 4 rather than 5 only because the author noted the local test run did not return a clean exit signal, so CI green is the final confirmation. No files require special attention. Reviews (1): Last reviewed commit: "Merge branch 'main' into issue-telegram-..." | Re-trigger Greptile |
Summary
reasoning:stream.<think>or backend reasoning deltas to surface as Telegram preview messages on normal sessions.stream, and add a regression test that verifies no reasoning preview callback is exposed otherwise.reasoning:streamsessions, and it does not change shared model reasoning semantics.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
extensions/telegram/src/bot-message-dispatch.tsenabled the reasoning draft lane withcanStreamAnswerDraft || streamReasoningDraft, so normal answer preview streaming created a reasoning-preview callback even when the session reasoning level wasoff.onReasoningStreamoutside explicitreasoning:streamsessions.<think>traces, so an overly broad Telegram preview lane is risky.Regression Test Plan (if applicable)
extensions/telegram/src/bot-message-dispatch.test.tsstream.reasoning:streambehavior, but not the off/default case.User-visible / Behavior Changes
reasoning:streamTelegram sessions keep their separate reasoning preview lane.Diagram (if applicable)
Security Impact (required)
Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
reasoning:stream.Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
onReasoningStreamrouting, and added a regression test for the default/off session case.reasoning:streamsessions still allocate the reasoning preview lane; default/off sessions now only allocate the answer preview lane.pnpm test:serialrun for the new Telegram regression test reachedRUNbut did not yield a clean exit signal in this workspace.Review Conversations
Compatibility / Migration
Risks and Mitigations
reasoning:streamsessions remain unchanged, which is the intended feature boundary.AI / Testing Notes
pnpm test:serialreachedRUNbut did not return a clean exit signal in this workspace.