- _ai_processor 改用 ThreadPoolExecutor(5 workers) 并行调用AI - _tg_worker 每轮排空所有待发TG消息(原来每轮只取1条) - fetch_unseen_emails 单封FETCH失败不再丢弃整个批次,跳过继续
- IMAP 连接加 30s socket timeout,防止 _send_id_command 等操作永久阻塞 - _email_poller 加顶层 try/except,异常后 sleep 5s 继续循环 - @retry() 加指数退避延迟(1s,2s,4s...),避免重试风暴
- sender 从 decode 改为使用原始 From 头 - 新增 recipient 字段,使用原始 To 头 - 移除 ai_process 中对 acct.username 的依赖
- email_client: log IMAP connection, login, UNSEEN count, each email details (subject/sender/body size), mark-as-seen progress - ai_client: log AI request params, timing, token usage, response size - smtp_client: log SMTP connect, login, send details - tg_bot: log all callback actions with subject context, message states - main: periodic queue depth report (email_queue/tg_queue/pending_uids)
- Replace logging.basicConfig with QueueHandler/QueueListener so all log output writes from a single thread - Add %(threadName)s to format for thread identification