feat(telegram): honor CLAUDE_MEM_TELEGRAM_ENABLED master toggle

Adds an explicit on/off flag (default 'true') so users can disable the
notifier without clearing credentials.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alex Newman
2026-04-22 12:52:04 -07:00
parent 965ec9c055
commit 5df7ee74b5
5 changed files with 48 additions and 42 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -63,6 +63,10 @@ async function postOne(botToken: string, chatId: string, text: string): Promise<
}
export async function notifyTelegram(input: TelegramNotifyInput): Promise<void> {
if (!SettingsDefaultsManager.getBool('CLAUDE_MEM_TELEGRAM_ENABLED')) {
return;
}
const botToken = SettingsDefaultsManager.get('CLAUDE_MEM_TELEGRAM_BOT_TOKEN');
const chatId = SettingsDefaultsManager.get('CLAUDE_MEM_TELEGRAM_CHAT_ID');
if (!botToken || !chatId) {

View File

@@ -77,6 +77,7 @@ export interface SettingsDefaults {
CLAUDE_MEM_CHROMA_TENANT: string;
CLAUDE_MEM_CHROMA_DATABASE: string;
// Telegram Notifier
CLAUDE_MEM_TELEGRAM_ENABLED: string;
CLAUDE_MEM_TELEGRAM_BOT_TOKEN: string;
CLAUDE_MEM_TELEGRAM_CHAT_ID: string;
CLAUDE_MEM_TELEGRAM_TRIGGER_TYPES: string;
@@ -153,6 +154,7 @@ export class SettingsDefaultsManager {
CLAUDE_MEM_CHROMA_TENANT: 'default_tenant',
CLAUDE_MEM_CHROMA_DATABASE: 'default_database',
// Telegram Notifier
CLAUDE_MEM_TELEGRAM_ENABLED: 'true',
CLAUDE_MEM_TELEGRAM_BOT_TOKEN: '',
CLAUDE_MEM_TELEGRAM_CHAT_ID: '',
CLAUDE_MEM_TELEGRAM_TRIGGER_TYPES: 'security_alert',