What's Fixed
Session ID Corruption — Critical Bug Fix
The problem: When multi-agent mode fell back to single agent mode, the system stored a JavaScript object ({ cid, completed }) instead of a plain UUID string as the claude_session_id. This corrupted value then broke:
- Session resumption (Claude couldn't continue previous conversations)
- Kanban task execution (tasks failed to resume their Claude session)
- Telegram chat (messages couldn't connect to the correct session)
- Open terminal command (refused to open with "Invalid session ID")
The fix: Comprehensive sanitization at every point where session IDs are read or written:
- New
sanitizeSessionId()utility — recursively unwraps objects, nested JSON strings, and embedded UUIDs to extract clean UUID strings. Handles even deeply corrupted values like{"cid":"{\"cid\":\"uuid\",\"completed\":true}","completed":false}. - Write-side protection — the
updateClaudeIddatabase statement now sanitizes before storing, preventing future corruption. - Read-side protection — all 7 locations where
claude_session_idis read from the database now pass throughsanitizeSessionId(): task execution, open-terminal endpoint, Telegram chat, WebSocket handler, legacy session resumption, and plan/rethink commands. - CLI-side guard —
claude-cli.jsvalidates that--resumereceives a proper UUID string, rejecting objects or corrupted values before they reach the Claude process. - Multi-agent fallback fix —
runMultiAgent()now correctly extracts.cidfrom therunCliSingle()return value, matching the expected contract of returning a plain session ID string.
Self-healing for existing data
If your database already contains corrupted session IDs from previous versions, this update will automatically extract the valid UUID at read time — no manual database cleanup needed.
Full Changelog: v5.25.6...v5.25.7