Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix(telegram): show full memory content in approval notifications

Adam Eivybfabbc5cd2b7
diff --git a/server/services/memory.js b/server/services/memory.js
index 79088ff12c..dfc0bfc7f9 100644
--- a/server/services/memory.js
+++ b/server/services/memory.js
@@ -189,7 +189,14 @@ export async function createMemory(data, embedding = null) {
}
/**
- * Get a memory by ID
+ * Read a memory by ID without updating access stats
+ */
+export async function peekMemory(id) {
+ return withMemoryLock(() => loadMemory(id));
+}
+
+/**
+ * Get a memory by ID (updates access stats)
*/
export async function getMemory(id) {
return withMemoryLock(async () => {
diff --git a/server/services/telegram.js b/server/services/telegram.js
index fd5452b243..35c9638d71 100644
--- a/server/services/telegram.js
+++ b/server/services/telegram.js
@@ -11,7 +11,7 @@ import { join } from 'path';
import { v4 as uuidv4 } from '../lib/uuid.js';
import { getSettings } from './settings.js';
import { notificationEvents, NOTIFICATION_TYPES, getNotifications } from './notifications.js';
-import { approveMemory, rejectMemory } from './memory.js';
+import { approveMemory, rejectMemory, peekMemory } from './memory.js';
import { ensureDir, PATHS, readJSONFile, formatDuration } from '../lib/fileUtils.js';
import { getActiveAgents } from './subAgentSpawner.js';
import { getGoals } from './identity.js';
@@ -377,19 +377,24 @@ async function forwardNotification(notification) {
const emoji = NOTIFICATION_EMOJI[notification.type] || '🔔';
const priorityEmoji = PRIORITY_EMOJI[notification.priority] || '';
const lines = [`${emoji} <b>${escapeHtml(notification.title)}</b>`];
- if (notification.description) lines.push(escapeHtml(notification.description));
- if (notification.priority) lines.push(`Priority: ${priorityEmoji} ${notification.priority}`);
-
const opts = { parse_mode: 'HTML' };
- if (notification.type === NOTIFICATION_TYPES.MEMORY_APPROVAL && notification.metadata?.memoryId) {
+ const isMemoryApproval = notification.type === NOTIFICATION_TYPES.MEMORY_APPROVAL && notification.metadata?.memoryId;
+
+ if (isMemoryApproval) {
+ const memory = await peekMemory(notification.metadata.memoryId);
+ const fullContent = memory?.summary || memory?.content || notification.description || '';
+ if (fullContent) lines.push(escapeHtml(fullContent));
opts.reply_markup = JSON.stringify({
inline_keyboard: [[
{ text: '✅ Approve', callback_data: `${CALLBACK_APPROVE}:${notification.metadata.memoryId}` },
{ text: '❌ Reject', callback_data: `${CALLBACK_REJECT}:${notification.metadata.memoryId}` }
]]
});
+ } else if (notification.description) {
+ lines.push(escapeHtml(notification.description));
}
+ if (notification.priority) lines.push(`Priority: ${priorityEmoji} ${notification.priority}`);
await sendMessage(lines.join('\n'), opts);
}