From 503922358184df07e74bb9855fdad525a9a29157 Mon Sep 17 00:00:00 2001 From: USO Status Date: Mon, 26 Jan 2026 20:39:01 +0100 Subject: [PATCH] fix(status): remove redundant final message timer --- src/auto-reply/reply/agent-runner.ts | 5 ++--- src/auto-reply/reply/status-updates.ts | 23 ++--------------------- 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/src/auto-reply/reply/agent-runner.ts b/src/auto-reply/reply/agent-runner.ts index 0a1e6d3f1..7c9a853a0 100644 --- a/src/auto-reply/reply/agent-runner.ts +++ b/src/auto-reply/reply/agent-runner.ts @@ -324,7 +324,7 @@ export async function runReplyAgent(params: { // NOTE: Edit mode requires channel-specific edit APIs which aren't available // at the agent-runner level. Use mode="inline" in config for now. // Telegram/Discord support editing but need integration at dispatch level. - let lastStatusMessageId: string | undefined; + const statusCallbacks = optsWithRunId?.onBlockReply ? { sendStatus: async (text: string, _messageId?: string) => { @@ -335,13 +335,12 @@ export async function runReplyAgent(params: { { timeoutMs: 3000 }, ); if (typeof res === "string") { - lastStatusMessageId = res; return res; } return undefined; }, editFinal: async (text: string, messageId: string) => { - log.debug(`Editing final status update: ${messageId} (tracked: ${lastStatusMessageId})`); + log.debug(`Editing final status update: ${messageId}`); await optsWithRunId.onBlockReply?.( { text, isStatusMessage: true, editMessageId: messageId }, { timeoutMs: 3000 }, diff --git a/src/auto-reply/reply/status-updates.ts b/src/auto-reply/reply/status-updates.ts index 25a829d79..bc704d2ae 100644 --- a/src/auto-reply/reply/status-updates.ts +++ b/src/auto-reply/reply/status-updates.ts @@ -202,10 +202,9 @@ export class StatusUpdateController { // If we have a final text and config says to mark with checkmark if (finalText && this.config.markFinalWithCheckmark) { - this.state.elapsedSeconds = Math.floor((Date.now() - this.state.startedAt) / 1000); // NOTE: We rely on Telegram delivery to do the edit/replacement, so we just format - // the string correctly for the final response. - const marked = `${finalText.trimEnd()} _(${formatElapsedTime(this.state.elapsedSeconds)})_`; + + const marked = `${finalText.trimEnd()} ✅`; return marked; } @@ -291,24 +290,6 @@ export function createStatusUpdateController( return new StatusUpdateController(config, callbacks); } -/** - * Mark a text response with the completion checkmark if enabled. - */ -export function markResponseComplete( - text: string | undefined, - config?: StatusUpdateConfig, -): string | undefined { - if (!text) return text; - - const resolved = resolveStatusUpdateConfig(config); - if (!resolved.enabled || !resolved.markFinalWithCheckmark) return text; - - // Don't double-mark - if (text.trimEnd().endsWith("✅")) return text; - - return `${text.trimEnd()} ✅`; -} - /** * Create status update callbacks for channels that support message editing. */