From d4580d1a31a28d7d3f0ebe1df2b93bbadc4f7eca Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Thu, 27 Nov 2025 18:14:20 +0100 Subject: [PATCH] Fix CI: type gaps and hasMedia check --- src/config/config.ts | 1 + src/web/auto-reply.ts | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/config/config.ts b/src/config/config.ts index 7a838d112..b2f8fb45e 100644 --- a/src/config/config.ts +++ b/src/config/config.ts @@ -64,6 +64,7 @@ export type WarelayConfig = { claudeOutputFormat?: ClaudeOutputFormat; // when command starts with `claude`, force an output format mediaMaxMb?: number; // optional cap for outbound media (default 5MB) typingIntervalSeconds?: number; // how often to refresh typing indicator while command runs + heartbeatMinutes?: number; // auto-ping cadence for command mode }; }; web?: WebConfig; diff --git a/src/web/auto-reply.ts b/src/web/auto-reply.ts index 543be1378..e7730bb22 100644 --- a/src/web/auto-reply.ts +++ b/src/web/auto-reply.ts @@ -147,8 +147,9 @@ export async function runWebHeartbeatOnce(opts: { return; } - const hasMedia = - (replyResult.mediaUrl ?? replyResult.mediaUrls?.length ?? 0) > 0; + const hasMedia = Boolean( + replyResult.mediaUrl || (replyResult.mediaUrls?.length ?? 0) > 0, + ); const stripped = stripHeartbeatToken(replyResult.text); if (stripped.shouldSkip && !hasMedia) { // Don't let heartbeats keep sessions alive: restore previous updatedAt so idle expiry still works. @@ -677,8 +678,9 @@ export async function monitorWebProvider( } const stripped = stripHeartbeatToken(replyResult.text); - const hasMedia = - (replyResult.mediaUrl ?? replyResult.mediaUrls?.length ?? 0) > 0; + const hasMedia = Boolean( + replyResult.mediaUrl || (replyResult.mediaUrls?.length ?? 0) > 0, + ); if (stripped.shouldSkip && !hasMedia) { heartbeatLogger.info( {