6 Commits
Author SHA1 Message Date
Claude b9af7ea7ba fix: handle errors and add error logging throughout codebase
The changes add error handling for previously ignored operations and introduce logging for critical errors and warnings. This includes:
- Adding error checks for file operations, JSON unmarshaling, system calls
- Logging warnings/errors for failed operations using slog
- Properly handling return values from functions that were previously ignored
- Adding context to error messages for better debugging
- Cleaning up unused code and variables

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-20 00:31:00 +08:00
AtticuszzandClaude Opus 4.6 77c457bed7 feat(gemini): optimize Gemini CLI display on Telegram
Improve the Gemini CLI headless mode (stream-json) experience on Telegram:

Stream preview & between-tool text:
- Add detachPreview() to preserve frozen preview messages on Telegram
- Track text segments (segmentStart) to flush between-tool text as
  separate messages instead of losing them
- Flush accumulated text before tool/thinking/permission interrupts

Tool display:
- Show full tool content without truncation (was limited to 500 chars)
- Compute line-level diff for replace operations (computeLineDiff)
  showing only changed lines with context, not entire old/new blocks
- write_file: show file path + content in code block
- shell/Bash: use ```bash code blocks for syntax highlighting
- Split long tool messages with SplitMessageCodeFenceAware

Gemini session management (/list, /switch):
- Read ~/.gemini/projects.json for correct project directory slug
- Scan session directory for matching sessionId (handles Gemini's
  session-<timestamp>-<uuid> naming)
- Handle both string and array content formats in session files
- Filter out subagent and empty sessions from /list

Markdown→HTML converter:
- Merge consecutive blockquote lines into single <blockquote>
- Add table rendering (pipe-delimited → readable text)
- Add unordered/ordered list support (bullets, numbered)
- Widen horizontal rule (3 → 10 em dashes)
- Rename to MarkdownToSimpleHTML (platform-agnostic naming)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 15:40:00 +08:00
chenhg5andClaude 8f630a0538 feat(commands): add support for exec commands with shell execution
Add ability to define custom slash commands that execute shell commands directly:
- Extend CommandConfig with Exec and WorkDir fields
- Add cmdCommandsAddExec handler for exec commands
- Implement executeShellCommand with timeout and output handling
- Add work_dir support for exec commands
- Update documentation and i18n messages
- Add tests and error handling

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-07 07:55:24 +08:00
chenhg5andClaude 1bba9e4a97 feat(config): add hot reload functionality for config
Add config reload capability that updates display settings, providers and commands without restart.
- Added config reload command (/config reload)
- Implemented ConfigReloadResult tracking updates
- Added ClearSource to CommandRegistry
- Updated help messages across languages
- Added SetConfigReloadFunc to Engine

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-05 01:26:45 +08:00
chenhg5andClaude e8e39413e8 refactor(session): add context-aware event sending and secure arg logging
Add context-aware select statements when sending events to prevent blocking on closed channels. Implement secure argument logging using RedactArgs to mask sensitive flags. Add atomic file writes and locks for config safety. Improve session handling with mutex protection and deduplication checks.

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-04 12:38:37 +08:00
chenhg5andClaude 522f9ff4c9 feat(commands): add custom slash command system with config and file-based commands
Add support for customizable slash commands that expand prompt templates with arguments. Includes:
- CommandProvider interface for agent-specific command directories
- Command registry with config.toml and agent file support
- Template expansion with placeholders ({{1}}, {{args}}, etc.)
- Dynamic command management via `/commands add/del`
- Multi-language support and documentation
- Example config additions and implementation for Claude/Gemini agents

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-04 07:34:00 +08:00