Skip to content

v1.2.3: Two bots on one machine keep their own state

Choose a tag to compare

@fidpa fidpa released this 16 Aug 11:58
· 7 commits to main since this release

Added

  • Every per-instance path derives from one setting. BOT_ID (default
    cc-telegram-bot) governs ~/<.BOT_ID>/ (sessions, audit log, alert database),
    /tmp/<BOT_ID>/ (downloaded media) and /run/<BOT_ID>/alerts.sock. Validated as a single
    path segment at startup, so a value like ../../etc aborts instead of escaping into the
    filesystem
  • The bot's role description can be changed without editing the source. BOT_PERSONA
    (default unchanged) sets the one-line role description at the top of the system prompt; the
    detailed personality stays in CLAUDE.md inside CLAUDE_WORKING_DIR

Fixed

  • Two instances of this bot on one machine shared their state without saying so. The data
    directory (~/.cc-telegram-bot) and temp directory (/tmp/telegram-bot) were hardcoded, so
    both wrote the same sessions.json: last write won, and a conversation could surface in the
    wrong bot. Set a distinct BOT_ID per instance
  • A bot without alerting no longer carries the alert half of the safety prompt. The alert
    rules (7 through 12, roughly half the safety prompt) were emitted unconditionally. They now
    follow the same gate as the runtime, since the alert socket only starts when a group is
    whitelisted (src/index.ts), so the rules only appear when TELEGRAM_ALLOWED_GROUPS is
    set. Without alerts the prompt drops from 4097 to 2181 characters, and the bot no longer
    carries instructions to scan DOCS_DIR and await /alert approval for a subsystem that
    never runs
  • A bot built on this code for another purpose was told it was an admin bot. The persona
    line was hardcoded as "You are a Claude-powered Telegram admin bot", which outranked the
    bot's own CLAUDE.md, because the system prompt wins

Changed

  • Dependencies raised: Claude Agent SDK 0.3.215 -> 0.3.233, MCP SDK 1.29.0 -> 1.30.0,
    TypeScript ^5 -> ^5.9.3