Commit Graph
77 Commits
Author SHA1 Message Date
kevinWangSheng 4f74588429 fix(engine): stop idle timer during permission wait
The idle timer in processInteractiveEvents kept running while
the event loop was blocked waiting for a user permission response.
If the user took longer than eventIdleTimeout to respond, the timer
would fire and kill the session on the next loop iteration.

Stop the idle timer before waiting on pending.Resolved and restart
it after the permission is resolved.
2026-03-08 17:29:09 -07:00
chenhg5andClaude 7d722d65a6 refactor(cmdCompress): improve compression command handling
Move compression logic to async goroutine with proper state handling.
Add event processing with timeout and cleanup.
Add i18n support for compression done message.

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-08 21:34:53 +08:00
chenhg5andClaude 754c65af32 feat(i18n): add new message keys and improve command formatting
Add new i18n message keys for various command responses (switch, timeout, relay bindings).
Improve formatting of command list output with better descriptions and shell command display.
Adjust Feishu platform message type detection threshold for posts.

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-08 21:17:25 +08:00
chenhg5andClaude c70d3eed7e feat(iflow): update CLI flags and preserve quiet state
Updated iFlow CLI integration flags from `-p` to `-i` for interactive mode.
Modified quiet mode handling to preserve state across session stops.
Added shell command support in i18n messages.
Fixed empty tool ID handling in iFlow session.

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-08 09:30:28 +08:00
chenhg5andClaude b14d34d7b2 feat(engine): add shell command execution capability
Add new `/shell` command (with aliases `/sh`, `/exec`, `/run`) to execute shell commands and return output. Includes timeout handling, working directory detection, output trimming, and error handling. Also adds command documentation in all supported languages.

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-08 09:09:23 +08:00
Rayquaza d4469bfafd Merge branch 'chenhg5:main' into main 2026-03-08 01:19:50 +08:00
Rayquaza 4e5d760bd2 feat(telegram): add bot command menu registration
- add BotCommandInfo and CommandRegistrar interface for platform abstraction
- implement GetAllCommands to collect builtin/custom commands and skills
- add i18n descriptions for all 30 builtin commands (en/zh/zh-TW/ja/es)
- implement RegisterCommands for Telegram setMyCommands API integration
2026-03-08 01:12:57 +08:00
cg33 82abdc0990 Merge pull request #19 from kevinWangSheng/fix/quiet-global-scope
fix: /quiet 改为全局作用域
2026-03-07 23:12:19 +08:00
chenhg5andClaude Opus 4.6 952a0e5d24 feat(relay): support multi-bot binding in group chats
- Add AddToBind() method to incrementally add projects to binding
- Add RemoveFromBind() method to remove specific project from binding
- Update /bind command to support multiple projects:
  - /bind <project> - add project to binding
  - /bind -<project> - remove specific project
  - /bind remove - clear all bindings
- Add debug logging for telegram group message filtering

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 18:49:23 +08:00
chenhg5andClaude 0179d098ce feat(commands): add interactive buttons for lang/model/mode commands
generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-07 08:36:30 +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 796526df50 feat(engine): add configurable agent idle timeout
Add support for configuring agent idle timeout duration via config file
(idle_timeout_mins). Defaults to 2 hours (changed from previous fixed 30 mins).
Timeout can be disabled by setting to 0.

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-07 00:21:40 +08:00
chenhg5andClaude 0c119d8682 refactor(engine): increase event idle timeout to 30 minutes
Adjust eventIdleTimeout constant from 5 to 30 minutes to better handle agent response scenarios. Also includes minor code formatting cleanup in Engine struct.

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-07 00:08:00 +08:00
kevinWangShengandClaude Opus 4.6 f97bf3dcc1 fix: /quiet 支持 per-session 和 global 两种模式
- /quiet:切换当前会话的静默模式,/new 后重置
- /quiet global:切换全局静默模式,跨会话生效,/new 不影响
- 事件处理时 global || session 任一为 true 即静默

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 06:36:51 -08:00
kevinWangShengandClaude Opus 4.6 c7d985edd9 fix: /quiet 改为全局作用域,不再跟随 session 重置
之前 quiet 绑定在 interactiveState 上,/new 或 /switch 会清掉 state 导致
quiet 被重置。用户开了静默模式换个 session 又要重新开一次,体验不好。

改为挂在 Engine 上,全局生效,/new /switch 不影响。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 06:35:59 -08:00
chenhg5andClaude Opus 4.6 54ea246f60 feat(i18n): add translation for session switch success message
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 20:34:13 +08:00
chenhg5andClaude Opus 4.6 16b028b098 feat(ui): improve status display and fix Feishu message formatting
- Add quiet mode status to /status command with i18n support
- Fix Feishu help command line breaks (use buildPostJSON instead of md tag)
- Improve tool message formatting (code block for long content)
- Strip XML tags from session summary display

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 20:31:37 +08:00
chenhg5andClaude 44c48de8f2 refactor(core): improve message splitting logic with boundary checks
Optimize the splitMessage function to handle newline boundaries more intelligently by checking if the boundary is in the second half of the chunk. Also simplifies the chunking logic and improves variable scoping.

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-06 17:52:23 +08:00
chenhg5andClaude 50ee383051 feat(engine): improve error handling for platform startups
Change engine startup to continue with partial failures instead of exiting.
Handle .old binary paths correctly during restarts. Update logging to reflect
partial startup status and improve restart reliability after updates.

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-06 17:07:20 +08:00
chenhg5andClaude 5befb5cc0e feat(search): add session search command with name/ID matching
Implement new `/search` command that allows searching sessions by:
- Session name or summary (case-insensitive)
- Session ID prefix
Adds internationalization support and usage documentation
Includes error handling and formatted results output

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-06 16:39:06 +08:00
chenhg5andClaude b0aa286c03 feat(cmd): add pagination support for list command
The cmdList function now accepts page arguments and displays paginated results. Added new i18n messages for paginated titles and hints. Implemented page size constant and page calculation logic.

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-06 16:19:00 +08:00
chenhg5andClaude 2a48df3224 fix(engine): add idle timeout for unresponsive agent sessions
Added eventIdleTimeout constant and idle timer logic to detect and handle stuck agent sessions that stop emitting events. The timer resets on each new event and terminates the session if no events are received within 5 minutes.

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-06 16:07:56 +08:00
chenhg5andClaude 802c694a92 feat(updater): improve update process with auto-restart and Gitee support
Add platform-specific restart handling with restart_unix.go and restart_windows.go. Enhance updater to support Gitee mirrors for Chinese users and automatically restart after updates. Improve version display in restart notifications and streamline update messages.

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-06 14:45:00 +08:00
chenhg5andClaude fcc0da88e2 feat(cron): add silent mode for cron job notifications
generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-06 14:00:12 +08:00
chenhg5andClaude aa4b9a495a feat(relay): add bot-to-bot relay functionality with CLI and API support
This commit introduces a new relay system for bot-to-bot communication, including:
- New `relay` command with send/bind functionality
- RelayManager for coordinating messages between engines
- API endpoints for relay operations
- Interactive `/bind` command for chat group binding
- Session handling and message forwarding
- CLI documentation and help messages
- Internationalization support for relay messages
- Stream preview improvements for relay messages

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-06 13:49:21 +08:00
chenhg5 53d5576b4b build: release v1.2.0-beta.5 — streaming preview, typing indicators, markdown rendering, rate limiting
Made-with: Cursor
2026-03-06 11:21:46 +08:00
chenhg5andClaude e40d033c3f feat(engine): enhance session switching and markdown conversion
- Improved `/switch` command to support session names and better matching logic
- Refactored markdown-to-HTML conversion with proper tag nesting and quote escaping
- Added detailed logging for streaming preview operations
- Fixed HTML tag validation in markdown tests
- Updated Telegram platform to handle HTML parsing errors gracefully

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-06 10:30:29 +08:00
chenhg5andClaude Opus 4.6 b8e8316968 feat: add typing indicator and fix HTML escaping
Typing Indicator:
- Add TypingIndicator interface for "processing" feedback
- Discord: send typing status every 8 seconds
- Telegram: send chat typing action every 5 seconds
- Feishu: add emoji reaction, remove when done

Markdown HTML Escaping:
- Fix HTML special chars (<, >, &) escaping in all contexts
- Use placeholder strategy: extract code/links, escape all, restore

Streaming Preview:
- Remove trailing cursor character from preview messages

Feishu Card:
- Add wide_screen_mode config

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 09:42:14 +08:00
chenhg5andClaude Opus 4.6 4b26663fd5 feat: improve markdown rendering and streaming preview
Streaming Preview:
- Add freeze() method to pause preview on permission prompts
- Improve finish() logic for better edge case handling

Markdown Rendering:
- Telegram: switch from Markdown to HTML mode with MarkdownToTelegramHTML
- Discord: use code-fence-aware message splitting
- Feishu: dual rendering strategy (card for code/tables, post for text)
- Feishu: support links, italic, strikethrough in inline parsing
- Feishu: use Patch API for card message updates

i18n:
- Use code blocks for permission prompt content
- Simplify button labels (remove emoji)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 09:14:50 +08:00
chenhg5andClaude Opus 4.6 e5d328d9d6 feat: add streaming preview and rate limiting support
Streaming Preview:
- Real-time message preview during agent response (like "typing" indicator)
- Supported on Telegram, Discord, and Feishu
- Configurable interval, min delta chars, and max preview length

Rate Limiting:
- Per-session sliding-window rate limiter
- Prevents users from flooding the bot with messages
- Configurable max messages and window size

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 07:02:37 +08:00
chenhg5andClaude Opus 4.6 00477f25a8 refactor(core): remove redundant fmt.Sprintf and add unit tests
- Remove unnecessary fmt.Sprintf wrapper around i18n.T() calls
- Add comprehensive unit tests for core module components

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 20:56:38 +08:00
chenhg5andClaude f31b3dd9be fix(engine): improve graceful shutdown and context handling
Add proper platform shutdown sequence before engine cleanup and check for canceled context in message processing and session creation to prevent operations during shutdown. Also reordered error collection for logical shutdown sequence.

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-05 17:54:39 +08:00
chenhg5andClaude b07b18e181 feat(engine): add project-level command disabling support
Implement disabled commands functionality for projects, including config parsing, engine integration, and i18n support. Allows disabling specific commands per-project via config.

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-05 14:43:51 +08:00
chenhg5andClaude d6a3a2253e feat: add banned words filter functionality
Add banned words configuration and filtering logic to block messages containing prohibited content. Includes:
- Config file support for banned_words list
- Engine methods to set and check banned words
- Case-insensitive matching during message processing
- Localization support for blocked message response
- Documentation updates in config example

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-05 13:59:25 +08:00
chenhg5andClaude 0667e970bf feat(agent): add session deletion capability
Implement session deletion functionality across all agent implementations (claudecode, codex, cursor, gemini)
Add new /delete command with session lookup by ID/prefix
Add i18n support for delete-related messages
Update command help texts to include new delete command
Add SessionDeleter interface for agents supporting deletion
Implement core deletion logic with active session protection

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-05 13:53:43 +08:00
chenhg5andClaude 958066feaa feat(sessions): improve session creation and naming
Add i18n support for session creation messages and ensure pending session names are properly set. Includes:
- Added MsgNewSessionCreated and MsgNewSessionCreatedName i18n messages
- Modified cmdNew to use i18n messages and handle empty names
- Set session name from pendingName in processInteractiveEvents if valid

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-05 13:12:38 +08:00
chenhg5andClaude e5b9b35278 feat(alias): add command alias support with config and runtime management
generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-05 10:17:43 +08:00
chenhg5 8917f4a2ef feat(session): add /name command, history provider for claude code, and improve list summary\n\n- Add /name command to set custom display names for sessions\n- Implement GetSessionHistory for claude code agent (fixes empty /history after /switch)\n- Change scanSessionMeta to use last user message as summary instead of first\n- Show custom session names in /list, /switch, and /status\n- Persist session names in SessionManager with full i18n support 2026-03-05 09:15:44 +08:00
chenhg5 fcdd11a79b feat(config): add default quiet mode setting at global and project level\n\nAllow users to configure quiet = true globally or per-project to\nsuppress thinking/tool progress messages by default. Project-level\nsetting overrides global. Users can still toggle with /quiet command. 2026-03-05 08:06:11 +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 c6fd0d6b31 feat(restart): add graceful restart capability with notifications
Add restart functionality triggered by /restart command:
- Persists restart requests across process termination
- Sends success notifications post-restart
- Includes internationalized messages
- Supports Discord slash command
- Uses syscall.Exec for clean restart

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-05 01:19:19 +08:00
chenhg5andClaude 4797b78823 feat(updater): add self-update command with GitHub/Gitee support
Add new `/upgrade` command to check for updates and self-update the binary:
- Checks releases from both GitHub and Gitee APIs
- Supports semver comparison for version checking
- Downloads and replaces binary automatically (except Windows)
- Includes i18n support for all messages
- Adds Discord slash command integration

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-05 01:04:15 +08:00
chenhg5andClaude e6fb09474c refactor(api): store http.Server instance and improve provider listing
- Store http.Server instance in APIServer struct for better resource management
- Enhance provider listing with current provider marker and remove bold formatting
- Update i18n strings for provider list titles

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-05 00:28:16 +08:00
chenhg5andClaude 216d2ef319 feat(command): add command prefix matching and improve help/session switching
Add builtinCommands list and prefix matching functionality for commands/subcommands. Improve session switching by supporting numeric indices. Update help messages and session listing format to reflect these changes. Simplify command parsing by removing redundant slash prefix handling.

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-05 00:19:38 +08:00
chenhg5andClaude 2c6f9e1831 refactor(cmdList): normalize and truncate summary display
Clean up command list summary display by:
- Replacing newlines with spaces
- Collapsing multiple spaces
- Adding truncation at 40 characters
- Keeping existing empty summary handling

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-05 00:04:18 +08:00
chenhg5andClaude 5e0a192b01 feat(claudecode): add provider proxy support for third-party endpoints
Add local reverse proxy support for third-party Claude providers with:
- Thinking parameter override rewriting
- Bearer token auth compatibility
- Provider clearing functionality
- Configurable thinking modes
- Improved provider management UX
- Enhanced markdown rendering for Feishu

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-04 23:57:13 +08:00
chenhg5andClaude f2920739d8 feat: add timeout handling for agent session closure
Added timeout mechanisms with logging for graceful session closure across multiple agent types (claudecode, codex, cursor, gemini, opencode, qoder). Modified engine cleanup to handle timeouts and improve logging. Sessions now timeout after 8-10 seconds with appropriate warnings/errors.

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-04 22:02:54 +08:00
cg33 1c69c843e4 Merge pull request #16 from kevinWangSheng/fix/feishu-post-and-slash-passthrough
fix: 飞书 post 富文本支持 & slash 命令透传
2026-03-04 18:11:17 +08:00
shenghui kevin 7e1fc2434c fix: 飞书 post 富文本消息支持 & 未识别 slash 命令透传给 agent
1. 飞书发图片或富文本时 msgType 为 post,之前直接忽略了,现在解析其中的文字和图片
2. cc-connect 不认识的 /xxx 命令之前直接报 Unknown command,现在透传给 agent 处理
2026-03-04 01:48:18 -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