This commit is contained in:
Luna
2026-03-01 16:25:02 +01:00
parent ccfd3c0854
commit f9bd2f1ee0
3 changed files with 2 additions and 10 deletions

View File

@@ -397,7 +397,6 @@ export async function findSimilar(userId, query) {
return retrieveRelevantMemories(db, userId, query);
}
// Daily thought storage
export async function getDailyThoughtFromDb(date) {
const db = await loadDatabase();
const row = get(db, 'SELECT thought FROM daily_thoughts WHERE date = ?', [date]);

View File

@@ -12,9 +12,6 @@ const dailyMoods = [
let overrideMood = null;
let currentDailyMood = null;
/**
* Get today's date as YYYY-MM-DD for comparison
*/
function getTodayDate() {
const d = new Date();
return d.toISOString().split('T')[0];
@@ -50,7 +47,6 @@ async function setDailyThought(thought) {
async function generateDailyThought() {
const today = getTodayDate();
// Check if we already have a thought for today in the DB
const existingThought = await getDailyThoughtFromDb(today);
if (existingThought) {
console.log('[mood] using existing thought for today:', existingThought);
@@ -68,7 +64,6 @@ async function generateDailyThought() {
const resp = await chatCompletion(messages, { temperature: 0.8, maxTokens: 40 });
newThought = (resp && resp.trim()) || '';
// Truncate to 120 characters if it exceeds
if (newThought.length > 120) {
newThought = newThought.substring(0, 117) + '...';
}
@@ -86,7 +81,6 @@ async function generateDailyThought() {
newThought = fallbacks[Math.floor(Math.random() * fallbacks.length)];
}
// Save to database
await saveDailyThought(today, newThought);
console.log('[mood] generated and saved new thought for today:', newThought);
return newThought;

View File

@@ -44,7 +44,6 @@ async function postJson(path, body) {
const e = new Error(`Request timed out after ${timeout}ms`);
e.code = 'UND_ERR_CONNECT_TIMEOUT';
controller.abort();
// store on global so the catch sees it
throw e;
}, timeout);