fix(telegram): show buttonless ask-user prompts (#130200)

Telegram progress streaming treated buttonless ask-user replies as transient progress, so multi-question prompts could disappear without a visible delivery. Keep ask-user payloads on the durable question path and cover the owner boundary with a regression test.

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
This commit is contained in:
Ayaan Zaidi
2026-08-26 22:17:00 +05:30
committed by GitHub
parent a2d54319bc
commit fc8a56daad
2 changed files with 22 additions and 0 deletions
@@ -329,6 +329,7 @@ export async function deliverReply(
const canRepresentAsTransientProgress =
!reply.hasMedia &&
telegramButtons === undefined &&
effectivePayload.channelData?.askUser === undefined &&
!hasExecApprovalPayload(effectivePayload);
const isFastModeProgressPayload = isFastModeAutoProgressPayload(effectivePayload);
if (turn.streamMode === "progress") {
@@ -479,6 +479,27 @@ describeTelegramDispatch("dispatchTelegramMessage progress-rendering", () => {
expect(finalText.length).toBeLessThanOrEqual(80);
});
it("delivers buttonless ask_user prompts outside transient progress", async () => {
const { answerDraftStream } = setupDraftStreams({ answerMessageId: 2001 });
dispatchReplyWithBufferedBlockDispatcher.mockImplementation(async ({ dispatcherOptions }) => {
await dispatcherOptions.deliver(
{
text: "Pick one or more",
channelData: {
askUser: { questionId: "ask_0123456789abcdef0123456789abcdef" },
},
},
{ kind: "tool" },
);
return { queuedFinal: true };
});
await dispatchWithContext({ context: createContext(), streamMode: "progress" });
expect(answerDraftStream.update).toHaveBeenCalledWith("Pick one or more");
expect(registerChannelDelivery).toHaveBeenCalledOnce();
});
it("streams interactive buttons into the same message", async () => {
const { answerDraftStream } = setupDraftStreams({ answerMessageId: 2001 });
dispatchReplyWithBufferedBlockDispatcher.mockImplementation(async ({ dispatcherOptions }) => {