Skip to content

Commit a2f9d69

Browse files
wendy-chsyclaude
andcommitted
fix(telegram): deliver reasoning lane under /reasoning on
Reasoning blocks from the reply pipeline carry isReasoning=true and are suppressed by normalizeDeliveryPayload via shouldSuppressReasoningPayload. Deliver them through the reasoning lane before the normalizer runs, so thinking persists as messages when /reasoning on is active (/reasoning stream worked because ephemeral streaming bypassed this path). Fixes #94937 Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent 1f244f6 commit a2f9d69

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

extensions/telegram/src/bot-message-dispatch.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1978,6 +1978,30 @@ export const dispatchTelegramMessage = async ({
19781978
return;
19791979
}
19801980

1981+
// Reasoning blocks carry isReasoning=true and are suppressed
1982+
// by normalizeDeliveryPayload (shouldSuppressReasoningPayload
1983+
// returns true). Deliver them directly through the reasoning
1984+
// lane so thinking persists under /reasoning on.
1985+
if (payload.isReasoning && typeof payload.text === "string") {
1986+
const reasoningText =
1987+
splitTelegramReasoningText(payload.text, true).reasoningText ??
1988+
payload.text;
1989+
if (reasoningText.trim()) {
1990+
reasoningStepState.noteReasoningHint();
1991+
await deliverLaneText({
1992+
laneName: "reasoning",
1993+
text: reasoningText,
1994+
payload,
1995+
infoKind: info.kind,
1996+
});
1997+
reasoningStepState.noteReasoningDelivered();
1998+
if (info.kind === "final") {
1999+
reasoningStepState.resetForNextStep();
2000+
}
2001+
}
2002+
return;
2003+
}
2004+
19812005
const normalizedPayload = normalizeDeliveryPayload(payload);
19822006
if (!normalizedPayload) {
19832007
return;

0 commit comments

Comments
 (0)