fix: quarantine dead brand commands + implement Memory LLM summary

Brand commands (~290 lines):
- Code was trapped inside `if reply_to_message:` block (unreachable)
- Moved to feature flag: ENABLE_BRAND_COMMANDS=true to activate
- Zero re-indentation: 8sp code naturally fits as feature flag body
- Helper functions (_brand_*, _artifact_*) unchanged

Memory LLM Summary:
- Replace placeholder with real DeepSeek API integration
- Structured output: summary, goals, decisions, open_questions, next_steps, key_facts
- Graceful fallback if API key not set or call fails
- Added MEMORY_DEEPSEEK_API_KEY config
- Ukrainian output language

Deployed and verified on NODE1.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Apple
2026-02-09 09:42:44 -08:00
parent 27e66b90bf
commit 3b924118be
3 changed files with 127 additions and 9 deletions

View File

@@ -1365,6 +1365,13 @@ async def handle_telegram_webhook(
f"(user {username} replied to bot msg {reply_to_message.get('message_id', '?')})"
)
# === BRAND COMMANDS (experimental, disabled by default) ===
# ~290 lines of brand/presentation command handlers.
# This code was NEVER active in production (was trapped inside wrong indent block).
# Quarantined behind feature flag. Enable with: ENABLE_BRAND_COMMANDS=true
# See: /бренд, /бренд_інтейк, /бренд_тема, /презентація, /job_статус
_brand_commands_enabled = os.environ.get("ENABLE_BRAND_COMMANDS", "").lower() in ("1", "true", "yes")
if _brand_commands_enabled:
text = update.message.get("text", "")
# Simple brand commands (Ukrainian)