Releases: jdrolls/pai-mobile
v2.2.0 — Long-Running Task Infrastructure
What's New
Tasks sent through the bot can now run for hours without being killed. Previously, a 10-minute hard timeout would terminate complex tasks (SSH operations, multi-file refactors, deployments) with a cryptic "exit code null" error.
Changes
- 4-hour safety cap replaces the 10-minute hard timeout —
/cancelis now the primary kill mechanism for user sessions - Progress pings every 5 minutes — "Still working... (X min elapsed). Use /cancel to stop."
- Process health checks — detects zombie processes (close event never fired) every 30 seconds
- Graceful shutdown — if the gateway restarts during a long task, it notifies the user instead of silently killing the process
/statusshows task duration — see how long the current task has been running- Better error messages — timeout, cancellation, and signal kills each get distinct, user-friendly messages instead of "exit code null"
- Partial result recovery — if Claude produced output before being killed, that output is returned instead of an error
Unchanged
- Lite mode timeout (2 min) — unchanged
- Heartbeat timeout (2 min) — hardcoded, unchanged
- Cron job timeout (5 min) — hardcoded, unchanged
/canceland AbortSignal flow — unchanged- Queue persistence and drain — unchanged
Files Modified
src/config.ts—fullTimeoutMs→ 4h, addedprogressPingIntervalMssrc/claude-runner.ts— health check, timeout/signal handling, partial resultssrc/index.ts— progress pings, task tracking, graceful shutdown,/statusenhancement
v2.1.2 — Telegram Command Menu & PAI Skill Discovery
What's New
Telegram Command Menu — Type / in your chat and you'll see a full menu of available commands. Built-in commands (like /new, /sessions, /cancel) are listed alongside any PAI skills you have installed.
PAI Skill Discovery — The gateway scans ~/.claude/skills/ at startup and registers discovered skills as Telegram bot commands. For example, if you have a Research skill, typing /research quantum computing routes it through Claude Code in full mode.
Details
- New
src/skills.tsmodule — scans skill directories, parses SKILL.md YAML frontmatter, normalizes to Telegram-safe command names registerBotCommands()wraps Telegram'ssetMyCommandsAPI- Skill routing rewrites
/skillname argsto"Use the SkillName skill: args"before passing to Claude - Built-in commands always take priority over skills (no collisions)
/helpnow shows discovered skills section- Telegram practical limit: ~50 total commands (13 built-in + up to 37 skills in menu). All discovered skills remain routable even if not in the menu.
- Registration is non-fatal — if it fails, the bot works normally without the command menu
full-system.mdincludes a skill routing hint so Claude invokes skills via the Skill tool
Full Changelog
v2.1.1 — Clean Telegram Response Formatting
Fix: PAI Formatting Stripped from Responses
v2.1.0 added a system prompt override to suppress PAI output formatting (═══ PAI headers, TASK/CONTENT/VERIFY sections). However, the system prompt only applies to new sessions — resumed sessions already have PAI formatting rules baked into Claude's context from ~/.claude/CLAUDE.md.
What Changed
Added a post-processing stripPaiFormatting() function that runs on every response before sending to Telegram. It strips:
═══ PAI ═══and════ PAI | NATIVE MODE ═══header lines🗒️ TASK:metadata lines🔧 CHANGE:and✅ VERIFY:sections (including sub-bullets)📋 SUMMARY:sections🗣️ BotName:prefix lines (used as fallback if no other content found)- Mode label emoji prefix (
💡/🔧) that was prepended to every message
Extracts the actual conversational content — 📃 CONTENT: text takes priority, then free-form text, then the bot summary line as fallback.
Before
🔧 ═══ PAI ═══════════════════════════
🗣️ DORA: Nice! Tsunami is a solid pick — enjoy your sushi!
After
Nice! Tsunami is a solid pick — enjoy your sushi!
Upgrade
Drop-in replacement. No config changes needed.
Full Changelog: v2.1.0...v2.1.1
v2.1.0 — Session Memory, Image Handling, PAI Integration
What's New
Session Memory System
Three-layer persistence that keeps your conversations coherent across messages:
- Transcript safety net — per-session JSONL recording. When Claude prunes a session and
--resumefails silently, the bot detects it and re-injects conversation context automatically. - Permanent memory —
MEMORY.mdat~/.claude/MEMORY/TELEGRAM/stores cross-session knowledge (8K char cap). Injected into new sessions. - Daily interaction logs — written to
~/.claude/MEMORY/RELATIONSHIP/YYYY-MM/YYYY-MM-DD.md. PAI'sLoadContexthook reads these automatically, so Telegram conversations surface in desktop Claude Code sessions with zero configuration.
Mode Stickiness
All sessions now auto-lock to full mode for context continuity. Previously, conversational messages like "Yes" or "What were we talking about?" were routed to stateless lite mode, losing all context. Both models use the same sonnet — zero cost difference. Use /lite to opt out if needed.
Image Support
Send photos or image documents via Telegram — they're downloaded, saved to a temp file, and forwarded to Claude with a hint to view them using the Read tool.
Resume Failure Detection
When --resume fails silently (session was pruned by Claude Code), the bot detects it by comparing returned session_id to the stored one. The next message gets conversation context prepended automatically.
Clean Response Format
System prompts now override PAI output formatting. No more ═══ PAI ═══ headers or emoji bullet sections in Telegram responses — just clean conversational text.
Files Changed
- New:
src/transcript.ts,src/memory.ts - Modified:
src/full.ts,src/index.ts,src/sessions.ts,src/telegram.ts - Prompts:
prompts/full-system.md,prompts/lite-system.md - Docs:
CLAUDE.md,README.md,package.json
Upgrade Notes
- No breaking changes — drop-in replacement for v2.0.0
- New
data/transcripts/anddata/memory/directories are created automatically on first run - If you have PAI installed, Telegram memory integrates automatically via
~/.claude/MEMORY/
Full Changelog: v2.0.0...v2.1.0
Beta 1.0.0
PAI Mobile — Beta 1.0.0
The first public beta of PAI Mobile, a Telegram gateway that connects your phone to Claude Code.
What's included
- Dual-mode routing — keyword classifier auto-routes simple questions (lite) vs complex tasks (full Claude Code with tools)
- Multi-session management — create, switch, and manage multiple conversation sessions
- Heartbeat system — periodic AI check-ins that alert you only when something is actionable
- Cron scheduler — natural language scheduled tasks ("daily 7am", "weekdays 9am", "every 2h")
- Outbound queue — bundles proactive messages, rate limits, retries
- macOS service management — launchd auto-start, crash recovery, one-command install
- Security hardening — chat ID whitelist, permission modes, env isolation for system sessions, rate limiting
Getting started
See the README for step-by-step setup instructions.
Feedback
This is a beta release for the PAI community. Open an issue or drop feedback in PAI Discussions.