- Fixed mom startup crash caused by settings API drift by using
SettingsManagerwith workspace-backed storage (#1444)
- Use coding-agent's SessionManager instead of custom MomSessionManager to fix API mismatch crash (#595)
AgentToolimport moved fromopen-pi-aitoopen-pi-agentAppMessagetype renamed toAgentMessageAttachmenttype replaced withImageContentfor image handlingMomSessionManager.loadSession()renamed tobuildSessionContex()MomSessionManager.createBranchedSessionFromEntries()signature changed tocreateBranchedSession(leafId)ProviderTransportremoved from Agent config, replaced with directgetApiKeycallbackmessageTransformerrenamed toconvertToLlmANTHROPIC_API_KEY/ANTHROPIC_OAUTH_TOKENno longer checked at startup (deferred to first API call)
- Session entries now include
idandparentIdfields for tree structure support - Auth lookup now uses
AuthStorageclass instead of direct environment variable access - Image attachments use
ImageContenttype withdatafield instead ofAttachmentwithcontent session.prompt()now usesimagesoption instead ofattachments
- Support for OAuth login via coding agent's
/logincommand (link~/.pi/agent/auth.jsonto~/.pi/mom/auth.json)
- Skill paths now use container paths: Skill file paths in system prompt are translated to container paths (e.g.,
/workspace/skills/...) so mom can read them from inside Docker.
- Skills auto-discovery: Mom now automatically discovers skills from
workspace/skills/andchannel/skills/directories. Skills are directories containing aSKILL.mdfile withnameanddescriptionin YAML frontmatter. Available skills are listed in the system prompt with their descriptions. Mom reads theSKILL.mdfile before using a skill.
- Events system: schedule wake-ups via JSON files in
workspace/events/- Immediate events: trigger when file is created (for webhooks, external signals)
- One-shot events: trigger at specific time (for reminders)
- Periodic events: trigger on cron schedule (for recurring tasks)
SlackBot.enqueueEvent()for queueing events (max 5 per channel)[SILENT]response marker: deletes status message, posts nothing to Slack (for periodic events with nothing to report)- Events documentation in
docs/events.md - System prompt section explaining events to mom
- Timestamp prefix now includes timezone offset (
[YYYY-MM-DD HH:MM:SS+HH:MM])
- Timestamp prefix on user messages (
[YYYY-MM-DD HH:MM:SS]) so mom knows current date/time
- Sync deduplication now strips timestamp prefix before comparing
- Duplicate message in context when message has attachments (sync from log didn't strip attachment section before comparing)
- Use
<slack_attachments>delimiter for attachments in messages (easier to parse/strip)
--download <channel-id>flag to download a channel's full history including thread replies as plain text
- Error handling: when agent returns
stopReason: "error", main message is updated to "Sorry, something went wrong" and error details are posted to the thread
- Attachment downloads now work correctly
- SlackBot now receives store for processing file downloads
- Files are downloaded in background and stored in
<channel>/attachments/ - Attachment paths passed to agent as absolute paths in execution environment
- Backfill also downloads attachments from historical messages
-
Complete rewrite of message handling architecture (#115)
- Now uses
AgentSessionfrom coding-agent for session management - Brings auto-compaction, overflow handling, and proper prompt caching
log.jsonlis the source of truth for all channel messagescontext.jsonlstores LLM context (messages sent to Claude, same format as coding-agent)- Sync mechanism ensures context.jsonl stays in sync with log.jsonl at run start
- Session header written immediately on new session creation (not lazily)
- Tool results preserved in context.jsonl for multi-turn continuity
- Now uses
-
Backfill improvements
- Only backfills channels that already have a
log.jsonlfile - Strips @mentions from backfilled messages (consistent with live messages)
- Uses largest timestamp in log for efficient incremental backfill
- Fetches DM channels in addition to public/private channels
- Only backfills channels that already have a
-
Message handling improvements
- Channel chatter (messages without @mention) logged but doesn't trigger processing
- Messages sent while mom is busy are logged and synced on next run
- Pre-startup messages (replayed by Slack on reconnect) logged but not auto-processed
- Stop command executes immediately (not queued), can interrupt running tasks
- Channel @mentions no longer double-logged (was firing both app_mention and message events)
-
Usage summary now includes context window usage
- Shows current context tokens vs model's context window
- Example:
Context: 4.2k / 200k (2.1%)
-
Slack API errors (msg_too_long) no longer crash the process
- Added try/catch error handling to all Slack API calls in the message queue
- Main channel messages truncated at 35K with note to ask for elaboration
- Thread messages truncated at 20K
- replaceMessage also truncated at 35K
-
Private channel messages not being logged
- Added
message.groupsto required bot events in README - Added
groups:historyandgroups:readto required scopes in README
- Added
-
Stop command now updates "Stopping..." to "Stopped" instead of posting two messages
- Port truncation logic from coding-agent: bash and read tools now use consistent 2000 lines OR 50KB limits with actionable notices
- Timestamps now use Slack format (seconds.microseconds) and messages are sorted by
tsfield- Migration required: Run
npx tsx scripts/migrate-timestamps.ts ./datato fix existing logs - Without migration, message context will be incorrectly ordered
- Migration required: Run
- Channel and user ID mappings in system prompt
- Fetches all channels bot is member of and all workspace users at startup
- Mom can now reference channels by name and mention users properly
- Skills documentation in system prompt
- Explains custom CLI tools pattern with SKILL.md files
- Encourages mom to create reusable tools for recurring tasks
- Debug output: writes
last_prompt.txtto channel directory with full context - Bash working directory info in system prompt (/ for Docker, cwd for host)
- Token-efficient log queries that filter out tool calls/results for summaries
- Turn-based message context instead of raw line count (#68)
- Groups consecutive bot messages (tool calls/results) as single turn
- "50 turns" now means ~50 conversation exchanges, not 50 log lines
- Prevents tool-heavy runs from pushing out conversation context
- Messages sorted by Slack timestamp before building context
- Fixes out-of-order issues from async attachment downloads
- Added monotonic counter for sub-millisecond ordering
- Condensed system prompt from ~5k to ~2.7k chars
- More concise workspace layout (tree format)
- Clearer log query examples (conversation-only vs full details)
- Removed redundant guidelines section
- User prompt simplified: removed duplicate "Current message" (already in history)
- Tool status labels (
_→ label_) no longer logged to jsonl - Thread messages and thinking no longer double-logged
- Duplicate message logging: removed redundant log from app_mention handler
- Username obfuscation in thread messages to prevent unwanted pings
- Handles @username, bare username, and <@USERID> formats
- Escapes special regex characters in usernames
- Reduced tool verbosity in main Slack messages (#65)
- During execution: show tool labels (with → prefix), thinking, and text
- After completion: replace main message with only final assistant response
- Full audit trail preserved in thread (tool details, thinking, text)
- Added promise queue to ensure message updates execute in correct order
- Working memory system with MEMORY.md files
- Global workspace memory (
workspace/MEMORY.md) shared across all channels - Channel-specific memory (
workspace/<channel>/MEMORY.md) for per-channel context - Automatic memory loading into system prompt on each request
- Mom can update memory files to remember project details, preferences, and context
- Global workspace memory (
- ISO 8601 date field in log.jsonl for easy date-based grepping
- Format:
"date":"2025-11-26T10:44:00.123Z" - Enables queries like:
grep '"date":"2025-11-26' log.jsonl
- Format:
- Centralized logging system (
src/log.ts)- Structured, colored console output (green for user messages, yellow for mom activity, dim for details)
- Consistent format:
[HH:MM:SS] [context] message - Type-safe logging functions for all event types
- Usage tracking and cost reporting
- Tracks tokens (input, output, cache read, cache write) and costs per run
- Displays summary at end of each agent run in console and Slack thread
- Example:
💰 Usage: 12,543 in + 847 out (5,234 cache read, 127 cache write) = $0.0234
- Working indicator in Slack messages
- Channel messages show "..." while mom is processing
- Automatically removed when work completes
- Improved stop command behavior
- Separate "Stopping..." message that updates to "Stopped" when abort completes
- Original working message continues to show tool results (including abort errors)
- Clean separation between status and results
- Enhanced system prompt with clearer directory structure and path examples
- Improved memory file path documentation to prevent confusion
- Message history format now includes ISO 8601 date for better searchability
- System prompt now includes log.jsonl format documentation with grep examples
- System prompt now includes current date and time for date-aware operations
- Added efficient log query patterns using jq to prevent context overflow
- System prompt emphasizes limiting NUMBER of messages (10-50), not truncating message text
- Log queries now show full message text and attachments for better context
- Fixed jq patterns to handle null/empty attachments with
(.attachments // []) - Recent messages in system prompt now formatted as TSV (43% token savings vs raw JSONL)
- Enhanced security documentation with prompt injection risk warnings and mitigations
- Moved recent messages from system prompt to user message for better prompt caching
- System prompt is now mostly static (only changes when memory files change)
- Enables Anthropic's prompt caching to work effectively
- Significantly reduces costs on subsequent requests
- Switched from Claude Opus 4.5 to Claude Sonnet 4.5 (~40% cost reduction)
- Tool result display now extracts actual text instead of showing JSON wrapper
- Slack thread messages now show cleaner tool call formatting with duration and label
- All console logging centralized and removed from scattered locations
- Agent run now returns
{ stopReason }instead of throwing exceptions- Clean handling of "aborted", "error", "stop", "length", "toolUse" cases
- No more error-based control flow
- jq query patterns now properly handle messages without attachments (no more errors on empty arrays)
- Initial release of Mom Slack bot
- Slack integration with @mentions and DMs
- Docker sandbox mode for isolated execution
- Bash tool with full shell access
- Read, write, edit file tools
- Attach tool for sharing files in Slack
- Thread-based tool details (clean main messages, verbose details in threads)
- Single accumulated message per agent run
- Stop command (
@mom stop) to abort running tasks - Persistent workspace per channel with scratchpad directory
- Streaming console output for monitoring