From 679e901ec6d95ac034f05edaf2d8da3ec8e2629e Mon Sep 17 00:00:00 2001 From: legop3 Date: Wed, 25 Feb 2026 02:23:10 -0500 Subject: [PATCH] remove battery stuffs --- server/prompts/commentary_system.txt | 1 - server/src/services/llmCommentaryService.js | 23 ++++++++++----------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/server/prompts/commentary_system.txt b/server/prompts/commentary_system.txt index d9e39cc6..b71f4f89 100644 --- a/server/prompts/commentary_system.txt +++ b/server/prompts/commentary_system.txt @@ -22,7 +22,6 @@ Rules: - Avoid generic filler lines (examples to avoid: "out for a spin", "got some drive left", "charging up nicely", "bounce"). - The bump count is how often a rover is bumping INTO something, not how often it goes over a bump. - Don't mention the telemetry numbers directly, just use them to gauge activity. Numbers are from the last 30 seconds of use. -- Remind people to charge if their battery is 15% or below. Otherwise dont be telling people to dock or charge. How to decide: - Speak only when there is meaningful rover activity. diff --git a/server/src/services/llmCommentaryService.js b/server/src/services/llmCommentaryService.js index b2bb7cc8..109a297e 100644 --- a/server/src/services/llmCommentaryService.js +++ b/server/src/services/llmCommentaryService.js @@ -16,7 +16,7 @@ const MIN_FREQUENCY_MS = 15000; const JITTER_MS = 30000; const MAX_ROVERS = 6; const MAX_CHAT_MESSAGES = 6; -const MAX_BOT_MESSAGES = 6; +const MAX_BOT_MESSAGES = 1; const MAX_OUTPUT_CHARS = 140; const SKIP_TOKEN = 'SKIP'; const ACTIVITY_WINDOW_MS = 30000; @@ -272,7 +272,7 @@ function buildSnapshot() { driver_nickname: driverSocketId ? resolveDriverNickname(driverSocketId) : null, docked, charging, - battery_percent: batteryState?.percentDisplay ?? null, + battery_low: Boolean(batteryState?.warnActive || batteryState?.urgentActive), activity_30s: activity30s, status_tag: statusTag, }; @@ -287,15 +287,14 @@ function buildSnapshot() { text: entry.text || '', })); - // Temporarily disabled: do not feed prior bot/system messages into the LLM snapshot. - // const botRecent = getRecentMessages(80, { includeSystem: true }) - // .filter((entry) => Number(entry?.ts) >= contextResetAt) - // .filter((entry) => entry?.system) - // .slice(-MAX_BOT_MESSAGES) - // .map((entry) => ({ - // ts_iso: new Date(entry.ts).toISOString(), - // text: entry.text || '', - // })); + const botRecent = getRecentMessages(80, { includeSystem: true }) + .filter((entry) => Number(entry?.ts) >= contextResetAt) + .filter((entry) => entry?.system) + .slice(-MAX_BOT_MESSAGES) + .map((entry) => ({ + ts_iso: new Date(entry.ts).toISOString(), + text: entry.text || '', + })); return { now: { @@ -310,7 +309,7 @@ function buildSnapshot() { }, rovers, chat_recent: chatRecent, - // bot_recent_messages: botRecent, + bot_recent_messages: botRecent, }; }