From 30d0f0c68619c5bb24a39ffe92cf1e754b22ae37 Mon Sep 17 00:00:00 2001 From: legop3 Date: Sat, 28 Feb 2026 11:56:25 -0500 Subject: [PATCH] skpi count --- server/prompts/commentary_system.txt | 7 +++++++ server/src/services/llmCommentaryService.js | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/server/prompts/commentary_system.txt b/server/prompts/commentary_system.txt index b7180783..27ef159f 100644 --- a/server/prompts/commentary_system.txt +++ b/server/prompts/commentary_system.txt @@ -19,6 +19,12 @@ Decision policy: - If your line would be generic, reusable, repetitive, or just plain status restatement, output SKIP. - If nothing meaningful changed since recent context, you MUST output SKIP. +Presence policy (sparse but present): +- Be sparse by default. +- Do not force chatter just because time passed. +- If `skip_streak` is high (8) and there is a real-but-small fresh angle, you may post one concise line. +- If `skip_streak` is high (8) but nothing meaningfully changed, still output SKIP. + Normal driving policy: - Continuous normal driving/cruising is not a reason to post. - If rover state is broadly unchanged (`st/bl/dk/ab/at`), output SKIP. @@ -51,4 +57,5 @@ Key legend: - CHAT keys: `n` nickname, `r` rover_id, `txt` chat text, `rn` rover_now. - `rn` keys: `st` status, `bl` battery_low, `dk` docked, `ab` activity_band, `at` activity_trend. - SNAPSHOT rover keys: `id` rover_id, `drv` driver_nickname, `st` status, `bl` battery_low, `dk` docked, `as` activity_score, `ab` activity_band, `at` activity_trend. +- `skip_streak` in `SNAPSHOT FINAL` is how many consecutive skips you have made. - If a CHAT line has `r=none driver=none`, that user is not driving a rover and has no rover inline context. diff --git a/server/src/services/llmCommentaryService.js b/server/src/services/llmCommentaryService.js index 38a376b5..7bf3d62b 100644 --- a/server/src/services/llmCommentaryService.js +++ b/server/src/services/llmCommentaryService.js @@ -892,9 +892,10 @@ function formatSnapshotMessage(event) { return lines.join('\n'); } -function formatSnapshotFinalMessage(currentSnapshot = {}) { +function formatSnapshotFinalMessage(currentSnapshot = {}, runMeta = {}) { const rovers = Array.isArray(currentSnapshot?.rovers) ? currentSnapshot.rovers : []; const lines = ['SNAPSHOT FINAL']; + lines.push(`skip_streak=${Number(runMeta?.skip_streak) || 0}`); rovers.forEach((rover) => { lines.push(formatRoverSnapshotLine(rover)); }); @@ -958,7 +959,7 @@ function buildModelMessages(systemPrompt, snapshot) { // Always end with a full rover snapshot user message. messages.push({ role: 'user', - content: formatSnapshotFinalMessage(snapshot?.current_snapshot || {}), + content: formatSnapshotFinalMessage(snapshot?.current_snapshot || {}, snapshot?.run_meta || {}), }); return messages; }