25 Commits

Author SHA1 Message Date
f0879f8d13 重构文件消息处理流程。 2026-05-25 11:59:29 +08:00
2bff987be1 飞书渠道简化 2026-05-13 18:07:34 +08:00
d957f9c649 feat(send_message): support file sending via Feishu; fix upload endpoint and message format
- OutboundMessenger trait: add media: Vec<MediaItem> param to send_message()
- send_message tool: add optional 'files' param with path-to-MediaItem conversion
- SessionManager::send_message(): forward media to OutboundMessage
- Feishu: fix image upload endpoint (/im/v1/images/upload → /im/v1/images)
- Feishu: fix post image tag (image → img)
- Feishu: fix file upload file_type mapping (use valid Feishu types)
- Feishu: send files as separate messages (file/audio/media msg_type), not embedded in post
- Feishu: add debug logging for upload/send responses
- Skip [message from] prefix for pure file messages to same session
2026-05-13 12:06:55 +08:00
81e9f1e7db clippy --fix: 合并嵌套if、简化map_or、移除冗余引用等机械性优化 2026-05-08 16:35:21 +08:00
ceb8234a30 飞书渠道剥离思维链内容,不显示<think>标签 2026-05-08 16:19:19 +08:00
5d62141658 1、修复和提升记忆系统 2、简化消息标记 2026-05-08 15:09:27 +08:00
c48ed83a23 refactor(session): 移除 InboundMessage.dialog_id,dialog_id 完全由 SessionManager 管理
Channel 消息不再携带 dialog_id,完全由 SessionManager 通过
current_sessions 内部管理。/new 后下一条消息会自动路由到新 session。

改动:
- InboundMessage 移除 dialog_id 字段
- handle_message 移除 dialog_id 参数
- Feishu/CLI channel 创建 InboundMessage 时不再设置 dialog_id
- 路由逻辑简化为:current_sessions → find_active_session → 创建新 session
2026-04-28 23:05:06 +08:00
e61b78eaff 重构:斜杠命令通过 handle_message 处理,Channel 不再管理 Session
架构优化:
- Feishu 渠道的 handle_and_publish 简化为只发布消息到 bus
- Session 创建/复用由 SessionManager 在 handle_message 内部处理
- 斜杠命令检测移到 handle_message,execute_slash_command 直接调用
- CLI 和 Feishu 统一通过消息总线处理斜杠命令
2026-04-28 21:10:28 +08:00
e787203e94 修复飞书渠道会话创建时机:执行斜杠命令前先确保会话存在
在 Feishu 收到斜杠命令时,先通过 CreateDialog 创建会话,
再执行实际的命令。这样 /dump 等命令就能正确获取对话历史。
2026-04-28 21:06:25 +08:00
30b68599a4 为飞书渠道添加斜杠命令支持
重写 FeishuChannel 的 handle_and_publish 方法,在发布消息前
检查是否为斜杠命令。如果是,则通过控制平面执行命令并返回结果。
2026-04-28 20:58:31 +08:00
1abac85034 集成技能功能到系统提示词框架
- 在 AgentLoop 中添加 SkillsLoader 支持\n- 在系统提示词构建中集成技能提示\n- 更新 Session 以传递 SkillsLoader\n- 修复所有编译错误和测试问题
2026-04-27 23:04:24 +08:00
f704900e07 统一工作目录管理 2026-04-27 17:23:52 +08:00
86dea0f874 Refactor session management to support dialog-based architecture
- Removed InputHandler and related input event handling code.
- Updated GatewayState to handle new session commands for dialogs.
- Introduced UnifiedSessionId for managing session identifiers across channels and chats.
- Refactored Session and SessionManager to manage dialogs instead of sessions.
- Added methods for creating, listing, switching, renaming, archiving, and deleting dialogs.
- Updated storage functions to accommodate dialog IDs in persistent session management.
- Enhanced tests to cover new dialog functionalities and ensure stability.
2026-04-26 20:59:54 +08:00
75281952d0 refactor: 统一 current_timestamp 函数到 bus::message 模块
- bus/message.rs: current_timestamp 改为 pub(crate) 导出
- cli_chat.rs: 删除本地定义,改用 crate:🚌:message::current_timestamp()
- feishu.rs: 改用 crate:🚌:message::current_timestamp()
- storage/mod.rs: 删除本地定义,改用 crate:🚌:message::current_timestamp()
2026-04-26 17:24:44 +08:00
ef80ae27ac fix(feishu): 修复内容类型处理,确保返回字符串格式 2026-04-26 11:22:01 +08:00
447cb2eee5 保存图片按实际格式储存。 2026-04-24 16:25:52 +08:00
dcf04279a7 feat(feishu): add reply context handling for messages and improve content fetching 2026-04-12 13:31:55 +08:00
3d72f3dfa8 feat(feishu): enhance message sending with dynamic format detection and support for interactive cards 2026-04-12 11:38:31 +08:00
21b4e60c44 feat(feishu): add reaction handling and metadata forwarding in messages 2026-04-08 10:24:15 +08:00
075b92f231 fix: truncate long text content before sending to Feishu
Feishu API rejects messages with content exceeding ~64KB with error
230001 "invalid message content". Added truncation at 60,000 characters
to prevent this, with a notice appended to truncated content.
2026-04-08 08:42:56 +08:00
2dada36bc6 feat: introduce multimodal content handling with media support
- Added ContentBlock enum for multimodal content representation (text, image).
- Enhanced ChatMessage struct to include media references.
- Updated InboundMessage and OutboundMessage to use MediaItem for media handling.
- Implemented media download and upload functionality in FeishuChannel.
- Modified message processing in the gateway to handle media items.
- Improved logging for message processing and media handling in debug mode.
- Refactored message serialization for LLM providers to support content blocks.
2026-04-07 23:09:31 +08:00
a051f83050 Refactor AgentLoop to manage history externally via SessionManager
- Removed internal history management from AgentLoop.
- Updated process method to accept conversation history as a parameter.
- Adjusted continue_with_tool_results to work with external history.
- Added OutboundDispatcher for handling outbound messages from MessageBus.
- Introduced InboundMessage and OutboundMessage structs for message handling.
- Updated Channel trait to include message handling and publishing to MessageBus.
- Refactored Session to manage chat histories instead of AgentLoop instances.
- Enhanced GatewayState to start message processing loops for inbound and outbound messages.
2026-04-07 21:53:37 +08:00
4ed2f986a1 添加 tracing 日志支持,替换 println! 输出,增强错误处理和调试信息 2026-04-06 23:11:41 +08:00
34ab439067 重构消息处理逻辑,添加 MessageHandler trait,支持多用户会话,更新 FeishuChannel 和 SessionManager,增强错误处理 2026-04-06 22:38:41 +08:00
04736f9f46 添加 Feishu 通道支持,重构配置以包含通道设置,更新依赖项,增强错误处理 2026-04-06 18:43:53 +08:00