feat: sync architecture upgrades from omnicloud-support-agent#26
feat: sync architecture upgrades from omnicloud-support-agent#26
Conversation
Major improvements: - SQS: Upgrade to FIFO queue for message ordering guarantee - Docker: Upgrade Node.js to 20+ for MCP undici compatibility - Docker: Change HOME to /tmp for MCP auth file writes - Security: Add Telegram webhook secret token verification (HMAC) - Handler: Add FIFO MessageGroupId/DeduplicationId support - Handler: Add /debug command for session file download - Handler: Add /start welcome message handler - Handler: Refactor local commands to support handler type - Consumer: Add continuous typing indicator (every 4s) - Consumer: Add Markdown conversion pipeline for Telegram - Consumer: Add message_time passthrough - Config: Add LocalCommand dataclass for handler type support - Dependencies: Add telegramify-markdown for Markdown conversion
Code reviewFound 1 issue:
The dedup_id = f"{chat_id}-{message_body.get('message_id')}-{uuid.uuid4().hex[:8]}"The deduplication ID should be deterministic based on message content. Suggested fix: dedup_id = f"{chat_id}-{message_body.get('message_id')}"Stateless-FileSystem-Agent/agent-sdk-client/handler.py Lines 91 to 93 in c11dd9c 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
CorrectionAfter further analysis, the issue raised above is not valid. The random UUID in Reasoning: The purpose of FIFO queue here is to guarantee message ordering within the same session (via If a Lambda times out and SQS retries the message, we want it to be reprocessed so the user eventually gets a response. Using a deterministic dedup ID would cause SQS to reject the retry within 5 minutes, leaving the user without a response. Apologies for the incorrect review. 🤖 Generated with Claude Code |
Summary
从 omnicloud-support-agent 同步通用架构改进,提升系统可靠性、安全性和用户体验。
主要改进
/root/tmp新增功能
/debug命令:下载当前会话的 session 文件/start命令:私聊欢迎消息message_time字段透传到 Agent Server文件变更
template.yaml: 添加 FIFO 队列配置、TelegramWebhookSecret 参数、Producer IAM 权限扩展Dockerfile: 升级 Node.js 20+、修改 HOME 为 /tmp、配置 npm 缓存handler.py: FIFO 消息支持、webhook 验证、handler 命令处理consumer.py: 持续打字指示、Markdown 转换管道config.py: LocalCommand dataclass 支持security.py: 添加 verify_telegram_secret_token 函数requirements.txt: 添加 telegramify-markdown 依赖破坏性变更
Test plan
/debug命令输出 session 文件