no tools only messages !!!

This commit is contained in:
legop3
2026-05-20 01:31:35 -04:00
parent 2da58920c4
commit ddb03bc809
2 changed files with 14 additions and 4 deletions
+1
View File
@@ -17,6 +17,7 @@ overseerControl:
enabled: false enabled: false
observeOnly: true observeOnly: true
alwaysRunModel: false alwaysRunModel: false
postToolsOnlyMessages: false
name: "The Overseer" name: "The Overseer"
model: "qwen2.5:7b-instruct" model: "qwen2.5:7b-instruct"
ollamaServer: "http://127.0.0.1:11434" ollamaServer: "http://127.0.0.1:11434"
@@ -41,6 +41,7 @@ const ollamaUrl = String(overseerConfig.ollamaUrl || overseerConfig.ollamaServer
const gateIntervalMs = normalizeMs(Number(overseerConfig.gateIntervalMs), DEFAULT_GATE_INTERVAL_MS); const gateIntervalMs = normalizeMs(Number(overseerConfig.gateIntervalMs), DEFAULT_GATE_INTERVAL_MS);
const heartbeatMs = normalizeMs(Number(overseerConfig.heartbeatMs), DEFAULT_HEARTBEAT_MS); const heartbeatMs = normalizeMs(Number(overseerConfig.heartbeatMs), DEFAULT_HEARTBEAT_MS);
const alwaysRunModel = Boolean(overseerConfig.alwaysRunModel); const alwaysRunModel = Boolean(overseerConfig.alwaysRunModel);
const postToolsOnlyMessages = Boolean(overseerConfig.postToolsOnlyMessages);
const profileImageUrl = String(overseerConfig.profileImageUrl || '').trim() || null; const profileImageUrl = String(overseerConfig.profileImageUrl || '').trim() || null;
const ollamaClient = ollamaUrl ? new Ollama({ host: ollamaUrl }) : null; const ollamaClient = ollamaUrl ? new Ollama({ host: ollamaUrl }) : null;
@@ -67,6 +68,7 @@ let status = {
gateIntervalMs, gateIntervalMs,
heartbeatMs, heartbeatMs,
alwaysRunModel, alwaysRunModel,
postToolsOnlyMessages,
running: false, running: false,
inFlight: false, inFlight: false,
phase: 'idle', phase: 'idle',
@@ -397,7 +399,7 @@ async function runDecision(triggerReason) {
if (toolCallFeed.length > 0) { if (toolCallFeed.length > 0) {
if ((decision === 'CHAT' || decision === 'ACTION+CHAT') && chatDraft) { if ((decision === 'CHAT' || decision === 'ACTION+CHAT') && chatDraft) {
sendSystemMessage(chatDraft, { nickname: name, bot: true, profileImage: profileImageUrl, toolCalls: toolCallFeed }); sendSystemMessage(chatDraft, { nickname: name, bot: true, profileImage: profileImageUrl, toolCalls: toolCallFeed });
} else { } else if (postToolsOnlyMessages) {
sendSystemMessage('', { nickname: name, bot: true, profileImage: profileImageUrl, toolCalls: toolCallFeed }); sendSystemMessage('', { nickname: name, bot: true, profileImage: profileImageUrl, toolCalls: toolCallFeed });
} }
} else if ((decision === 'CHAT' || decision === 'ACTION+CHAT') && chatDraft) { } else if ((decision === 'CHAT' || decision === 'ACTION+CHAT') && chatDraft) {
@@ -473,14 +475,18 @@ function emitStateToSocket(socket) {
socket.emit('overseer:state', buildAdminState(status, runtime.runHistory)); socket.emit('overseer:state', buildAdminState(status, runtime.runHistory));
} }
function clearHistory(reason = 'admin requested clear history') { function clearHistory(reason = 'admin requested clear history', options = {}) {
const resetPersistentMemory = options?.resetPersistentMemory !== false;
const sendConfirmation = options?.sendConfirmation === true;
runtime.contextResetAt = Date.now(); runtime.contextResetAt = Date.now();
runtime.runHistory = []; runtime.runHistory = [];
runtime.liveToolCalls = []; runtime.liveToolCalls = [];
runtime.generationCount = 0; runtime.generationCount = 0;
runtime.generationTotalMs = 0; runtime.generationTotalMs = 0;
runtime.lastModelAt = 0; runtime.lastModelAt = 0;
if (resetPersistentMemory) {
runtime.memoryStore = saveMemory(createDefaultMemory()); runtime.memoryStore = saveMemory(createDefaultMemory());
}
try { try {
clearChatHistory(); clearChatHistory();
} catch (err) { } catch (err) {
@@ -506,6 +512,9 @@ function clearHistory(reason = 'admin requested clear history') {
lastOutcome: 'cleared', lastOutcome: 'cleared',
lastReason: reason, lastReason: reason,
}); });
if (sendConfirmation) {
sendSystemMessage('Context cleared.', { nickname: name, bot: true, profileImage: profileImageUrl });
}
} }
function stopScheduler(reason = 'paused') { function stopScheduler(reason = 'paused') {
@@ -572,7 +581,7 @@ subscribe('chat:message', ({ payload } = {}) => {
const text = String(payload?.text || '').trim(); const text = String(payload?.text || '').trim();
if (text !== 'CLEAR') return; if (text !== 'CLEAR') return;
if (payload?.bot) return; if (payload?.bot) return;
clearHistory('chat CLEAR command'); clearHistory('chat CLEAR command', { resetPersistentMemory: false, sendConfirmation: true });
}); });
verificationEvents.on('change', () => evaluateSchedulerGate('online vote update')); verificationEvents.on('change', () => evaluateSchedulerGate('online vote update'));
homeAssistantEvents.on('update', () => updateStatus({ phase: status.phase })); homeAssistantEvents.on('update', () => updateStatus({ phase: status.phase }));