14 Commits

Author SHA1 Message Date
Azreen Jamal 9bc94b0bab add nexus, hyperloop, model-router extensions and update themeMap, justfile 2026-03-10 01:32:15 +08:00
Azreen Jamal bd2c7d5102 feat: pi-worker now picks up and fixes real bugs from Asana
Major changes:
- Task loop polls Under Review + New Bugs sections (was only checking empty sections)
- Smart project routing: keyword matching maps task names to correct codebase
  (e.g. 'pledge' → legacy-donation-system-laravel)
- Pi executes in the project directory, not /opt/pi-worker
- Git pull before execution to get latest code
- Skips already-attempted tasks (checks Asana comments)
- Config now exposes projectsPath

First real bug fixed autonomously:
  'Duplicate Pledges Detected with Same External Reference'
  → Fixed uniqid() causing duplicate Engage pledges on every sync
  → 1 file changed in app/N3O/Schema.php

Also: fix watchdog to use systemd-notify command (unix_dgram unsupported in Bun),
add debug logging to lock acquire failures
2026-03-09 01:33:24 +08:00
Azreen Jamal 40ae8f4fb7 feat: increase telegram bot session limit from 100KB to 100,000KB 2026-03-08 22:58:41 +08:00
Azreen Jamal a86865ee25 fix: raw fetch polling loop - bypasses Grammy polling, handles 409 gracefully
- Replaced Grammy bot.start() with manual fetch-based getUpdates loop
- Grammy used only for bot.handleUpdate() (middleware/handlers)
- 409 conflicts handled with 10s backoff + continue (no crash)
- Network errors handled with 3s retry
- Root cause of persistent 409: zombie bun process (PID 72407) from 3:23 AM
  was holding Telegram long-poll lock all day
2026-03-06 21:41:51 +08:00
Azreen Jamal ccfa969261 feat: major telegram bot rewrite - security, UX, smart commands
- SECURITY: cwd=/tmp, strip ANTHROPIC_API_KEY from Pi env
- FIX: recursive retry now has max retries counter
- FIX: await processMessage, proper error handling
- FIX: ESM imports only (no require)
- FIX: full stderr drain, check SSH exit codes
- UX: single progress message edited in-place (no spam)
- UX: HTML formatting for commands output
- UX: session warning at 80KB, auto-clear at 100KB
- UX: block concurrent tasks per user
- SMART: /health command - check pi-worker status
- SMART: /asana command - list open tasks
- SMART: /status uses edit-in-place
- SMART: /ssh shows exit code
- CLEAN: removed dead deps reference
2026-03-06 21:15:18 +08:00
Azreen Jamal 91b8ceeac9 feat: sweep My Tasks (Recently Assigned) for already-done tasks 2026-03-06 16:51:01 +08:00
Azreen Jamal 6e074fd512 feat: add pi-worker service for autonomous Asana task execution and project improvements 2026-03-06 15:14:43 +08:00
Azreen Jamal 28465884fc telegram-bot: fix streaming JSON, session bloat, prevent local command execution
- Fix progress messages showing [object Object] - parse tool_execution_start/end events
- Auto-clear sessions >200KB to prevent context bloat timeouts
- Restrict bash tool to SSH and curl only - prevent recursive Pi spawning
- Proper error messages for timeouts
2026-03-06 04:20:02 +08:00
Azreen Jamal b5d8665ac0 telegram-bot: rewrite to use Pi CLI with streaming JSON output
- Replaced direct Anthropic API with Pi CLI (uses platform auth, no API key needed)
- Model: claude-sonnet-4-6
- Streaming JSON mode with live progress updates in Telegram
- Per-user session files via Pi's --session/--continue
- Auto-recovery from corrupted sessions
- 5 min timeout, not-lazy system prompt
2026-03-06 02:58:58 +08:00
Azreen Jamal bcce1d4549 update extensions, telegram bot, and add giveaway module 2026-03-05 18:11:32 +08:00
Azreen Jamal a7413075c3 telegram bot: fix env loading, remove markdown, clear stale updates 2026-03-03 04:19:37 +08:00
Azreen Jamal dd2ce7e81f telegram bot: launchd install/uninstall scripts for macOS 2026-03-03 04:16:27 +08:00
Azreen Jamal 5f8f7a1591 telegram bot: hardened auth, rate limiting, dangerous cmd blocking, private-only 2026-03-03 04:14:16 +08:00
Azreen Jamal c6c1e06048 telegram bot: two-way Claude chat + SSH command runner 2026-03-03 04:10:57 +08:00