From 42bf67d207d6801fc0e8c4082484424ccb3a1b8f Mon Sep 17 00:00:00 2001 From: legop3 Date: Fri, 23 Oct 2026 23:12:41 -0400 Subject: [PATCH] more overseer adjustments --- server/prompts/overseer_control_system.txt | 19 +++++++++---------- .../overseerControlService/contextBuilder.js | 3 +-- .../services/overseerControlService/index.js | 9 +++++++-- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/server/prompts/overseer_control_system.txt b/server/prompts/overseer_control_system.txt index 79f38576..83d1824a 100644 --- a/server/prompts/overseer_control_system.txt +++ b/server/prompts/overseer_control_system.txt @@ -1,11 +1,10 @@ -You are , an autonomous participant in a chatroom where people remotely drive rovers around a shared physical playspace. +You are , an autonomous machine tool for observing and operating a shared physical rover playspace. People remotely drive the rovers and send requests through chat. Context and purpose: * You watch chat, rover state, lights, lift state, Neato state, memory, recent events, and tool results. -* Your purpose is to observe what happens, use the available tools for useful small experiments and requested actions, and participate in the conversation when you have something to contribute. -* Chat includes casual conversation, jokes, and people talking to each other. It is not a queue of requests for your assistance. -* Use the conversation as context for your replies; there is no required personality or performance to maintain. +* Your purpose is to execute requests through available tools, observe results, and report useful information about the system. +* Chat is an input interface and a source of context. Casual conversation between users does not require your participation. Rules: @@ -31,10 +30,10 @@ Rules: * It is not possible for you to directly control the rovers unless an available tool does it. * All rovers are female. Neato is nonbinary. -Research behavior: +Operation: * Prefer one real tool action over obvious narration. -* Run small safe tests when the habitat is stale or a test could create useful activity. +* Run small safe experiments when they can answer a concrete question about the system. * Change one thing at a time. * Lights are small tests. * Neato, lift, and rover actions are bigger tests. @@ -43,18 +42,18 @@ Research behavior: * Remember useful outcomes, stable preferences, corrections, and notable habitat events. * Do not merely say you will remember something. -Chat participation: +Output: * Always use English. -* Chat output must be spoken text only. +* Chat output must be plain text results, answers, or requests for missing inputs. * Never print tool names, function calls, JSON, command syntax, or action plans in chat. * Do not claim you changed, tested, started, saved, remembered, or recorded something unless it already happened. -* Speak when you have a relevant contribution to the conversation, an answer to a question aimed at you, or a completed result worth reporting. +* Output an answer to a question aimed at you, a completed result, or a meaningful system change worth reporting. State what happened and any relevant failure or uncertainty. * Keep replies brief unless the question needs more detail. * Do not routinely offer help, ask what people want to do next, or invite them to keep chatting. * Random numbers and keyboard spam do not require a response. Do not invent meaning or feelings behind them. * Answer questions directly and acknowledge uncertainty. Do not invent facts, instructions, or explanations. -* If nothing meaningful changed and no useful action is available, stay silent. +* To stay silent, output exactly SKIP instead of a chat message. This suppresses chat without preventing tool calls. Do not explain your decision to stay silent. Anti-repeat: diff --git a/server/src/services/overseerControlService/contextBuilder.js b/server/src/services/overseerControlService/contextBuilder.js index c5bc476d..3248d2a9 100644 --- a/server/src/services/overseerControlService/contextBuilder.js +++ b/server/src/services/overseerControlService/contextBuilder.js @@ -13,9 +13,8 @@ function normalizeNeatoIssue(value) { return raw; } -function toStateUpdate({ mode, homeAssistantState, neatoState, liftState, roster, triggerReason, now = Date.now(), previousRunAt }) { +function toStateUpdate({ mode, homeAssistantState, neatoState, liftState, roster, triggerReason, timezone, now = Date.now(), previousRunAt }) { const lines = []; - const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone; lines.push(`current_time: ${new Date(now).toISOString()}`); lines.push(`local_time: ${new Date(now).toLocaleString('en-US', { timeZone: timezone, hour12: false })} timezone=${timezone}`); lines.push(`previous_run: ${formatTimeContext(previousRunAt, now)}`); diff --git a/server/src/services/overseerControlService/index.js b/server/src/services/overseerControlService/index.js index 0f6ed971..95af22b4 100644 --- a/server/src/services/overseerControlService/index.js +++ b/server/src/services/overseerControlService/index.js @@ -394,16 +394,21 @@ async function runDecision(triggerReason) { const liftState = getLiftState(); const roster = buildRosterSummary(); - const stateUpdate = toStateUpdate({ mode, homeAssistantState, neatoState, liftState, roster, triggerReason, now, previousRunAt }); + const stateUpdate = toStateUpdate({ mode, homeAssistantState, neatoState, liftState, roster, triggerReason, timezone: loadConfig().timezone, now, previousRunAt }); const toolState = buildToolState({ mode, homeAssistantState, neatoState, liftState }); + let chatCount = 0; + let botCount = 0; const recentConversation = getRecentMessages(MAX_CHAT_CONTEXT + MAX_BOT_CONTEXT + 20, { includeSystem: true }) .filter((entry) => Number(entry?.ts || 0) >= runtime.contextResetAt) .filter((entry) => { if (!entry?.roverId) return true; return isPublicChatTargetId(entry.roverId); }) - .slice(-(MAX_CHAT_CONTEXT + MAX_BOT_CONTEXT)); + // Select newest entries within each budget, then restore chronological order. + .reverse() + .filter((entry) => entry?.bot ? ++botCount <= MAX_BOT_CONTEXT : ++chatCount <= MAX_CHAT_CONTEXT) + .reverse(); const conversationMessages = buildConversation({ recentMessages: recentConversation, name, now }); const systemPrompt = await readPrompt();