stripAnsi misses some escape sequences like standalone ESC \ (String
Terminator) which caused rendering issues when displaying captured TUI
output. Now also removes any remaining ESC+char sequences and control
characters after stripAnsi processing.
- Use truncateToWidth instead of substring in user-message-selector.ts
- Fix truncateToWidth to use Intl.Segmenter for proper grapheme handling
- Add tests for Unicode truncation behavior
- Add 'authHeader' boolean option to models.json provider config
When true, adds 'Authorization: Bearer <apiKey>' to model headers
Useful for providers requiring explicit auth headers (fixes#81)
- Fix print mode (-p) silently failing on errors
Now outputs error message to stderr and exits with code 1
when assistant message has stopReason of error/aborted
- Add try/catch to all Slack API calls in promise chain
- Truncate main channel messages at 35K with elaboration note
- Truncate thread messages at 20K
- Prevents process crash on long messages
- Add message.groups to required bot events in README
- Add groups:history and groups:read to required scopes in README
- app_mention handler now logs messages directly instead of relying on message event
- Add deduplication in ChannelStore.logMessage() to prevent double-logging
- Remove redundant current message append in agent.ts (already in log)
- RPC mode now auto-compacts when context exceeds threshold (same as TUI)
- Add RPC test for manual compaction via compact command
- Auto-compaction emits compaction event with auto: true flag
- Add /compact command for manual context compaction with optional custom instructions
- Add /autocompact command to toggle automatic compaction
- Auto-trigger compaction when context usage exceeds threshold (contextWindow - reserveTokens)
- Add CompactionComponent for TUI display with collapsed/expanded states
- Add compaction events to HTML export with collapsible summary
- Refactor export-html.ts to eliminate duplication between session and streaming formats
- Use setTimeout to break out of agent event handler for safe async compaction
- Show compaction summary in TUI after compaction completes
fixes#92
- Add CompactionEntry type with firstKeptEntryIndex
- Add loadSessionFromEntries() for compaction-aware loading
- Add compact() function that returns CompactionEntry
- Add token calculation and cut point detection
- Add tests with real session fixture and LLM integration
Still TODO: settings, /compact and /autocompact commands, auto-trigger in TUI, /branch rework
- Add getLastTimestamp() to ChannelStore to read last ts from log.jsonl
- Add backfillChannel() to fetch up to 3 pages (3000 messages) per channel
- Add backfillAllChannels() called in start() before socket connection
- Include mom's own messages (as bot) and user messages, exclude other bots
- Process attachments from backfilled messages
- Add logging: logBackfillStart, logBackfillChannel, logBackfillComplete
- Warn if attachment missing name instead of failing
fixes#103
pi-ai:
- Fixed usage.input to exclude cached tokens for OpenAI providers
- Previously input included cached tokens, causing double-counting
- Now input + output + cacheRead + cacheWrite correctly gives total context
coding-agent:
- Session header now includes branchedFrom field for branched sessions
- Updated compaction.md with refined implementation plan
- Updated session.md with branchedFrom documentation
- Add piConfig to package.json for app name and config directory
- Consolidate paths.ts into config.ts with clearer naming
- Fix Bun binary detection (changed from %7EBUN to $bunfs)
- Update all hardcoded paths to use config.ts exports
- getThemesDir() for built-in themes, getCustomThemesDir() for user themes