Fix CI: type gaps and hasMedia check

This commit is contained in:
Peter Steinberger
2025-11-27 18:14:20 +01:00
parent 93a103dde5
commit d4580d1a31
2 changed files with 7 additions and 4 deletions

View File

@@ -64,6 +64,7 @@ export type WarelayConfig = {
claudeOutputFormat?: ClaudeOutputFormat; // when command starts with `claude`, force an output format claudeOutputFormat?: ClaudeOutputFormat; // when command starts with `claude`, force an output format
mediaMaxMb?: number; // optional cap for outbound media (default 5MB) mediaMaxMb?: number; // optional cap for outbound media (default 5MB)
typingIntervalSeconds?: number; // how often to refresh typing indicator while command runs typingIntervalSeconds?: number; // how often to refresh typing indicator while command runs
heartbeatMinutes?: number; // auto-ping cadence for command mode
}; };
}; };
web?: WebConfig; web?: WebConfig;

View File

@@ -147,8 +147,9 @@ export async function runWebHeartbeatOnce(opts: {
return; return;
} }
const hasMedia = const hasMedia = Boolean(
(replyResult.mediaUrl ?? replyResult.mediaUrls?.length ?? 0) > 0; replyResult.mediaUrl || (replyResult.mediaUrls?.length ?? 0) > 0,
);
const stripped = stripHeartbeatToken(replyResult.text); const stripped = stripHeartbeatToken(replyResult.text);
if (stripped.shouldSkip && !hasMedia) { if (stripped.shouldSkip && !hasMedia) {
// Don't let heartbeats keep sessions alive: restore previous updatedAt so idle expiry still works. // 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 stripped = stripHeartbeatToken(replyResult.text);
const hasMedia = const hasMedia = Boolean(
(replyResult.mediaUrl ?? replyResult.mediaUrls?.length ?? 0) > 0; replyResult.mediaUrl || (replyResult.mediaUrls?.length ?? 0) > 0,
);
if (stripped.shouldSkip && !hasMedia) { if (stripped.shouldSkip && !hasMedia) {
heartbeatLogger.info( heartbeatLogger.info(
{ {