Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/telegram-live-task-no-completed-edit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@roomote/communication': patch
'@roomote/sdk': patch
---

Telegram live coding-task messages no longer get edited to a "Completed." status when a task finishes successfully. The last live update stays visible as-is, and a resumed run keeps updating that same message with current progress.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ Waiting for your input…

Open in Roomote: https://roomote.example/sessions/session-1?task=task-1&utm_source=telegram

COMPLETED
Completed.

Open in Roomote: https://roomote.example/sessions/session-1?task=task-1&utm_source=telegram

FAILED
Task failed.

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions packages/communication/src/telegram-live-task-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { TELEGRAM_MAX_MESSAGE_LENGTH } from './telegram-format';
export type TelegramLiveTaskStatus =
| 'running'
| 'waiting'
| 'completed'
| 'failed'
| 'stopped';

Expand Down Expand Up @@ -49,8 +48,6 @@ function getStatusText(status: TelegramLiveTaskStatus): string {
return 'Starting task…';
case 'waiting':
return 'Waiting for your input…';
case 'completed':
return 'Completed.';
case 'failed':
return 'Task failed.';
case 'stopped':
Expand Down
49 changes: 40 additions & 9 deletions packages/sdk/src/server/lib/telegram-live-task-stream.test.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions packages/sdk/src/server/lib/telegram-live-task-stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,12 @@ export async function renderTelegramLiveTaskStream(input: {
const data = await getTelegramLiveTaskStreamData(input.taskId);
if (!data) return { card: false, updated: false };

// The owning Fast Session posts the successful result. Preserve the live
// message and its pointer so a resumed run can continue editing it.
if (input.status === 'complete') {
return { card: true, updated: true };
}

const provider =
await createTelegramCommunicationProviderFromRuntimeCredentials();
if (!provider) return { card: false, updated: false };
Expand All @@ -179,11 +185,9 @@ export async function renderTelegramLiveTaskStream(input: {
? input.details?.trim() === 'Waiting for your input…'
? 'waiting'
: 'running'
: input.status === 'complete'
? 'completed'
: input.output === 'Stopped.'
? 'stopped'
: 'failed';
: input.output === 'Stopped.'
? 'stopped'
: 'failed';
await provider.editMessageText({
channelId: data.channelId,
messageId: data.messageId,
Expand Down
Loading