6ce9a806ea
fix: clear reply suggestions cache on cancel, regenerate when switching styles - Cancel now clears reply_suggestions from email_context - Selecting style with empty cache triggers fresh AI generation - Selecting style with cache uses cached suggestions - Tests: 3/3 passing
2026-07-17 20:33:09 +08:00
84f2428aeb
fix: send AI suggestion as MarkdownV2 code block for copy-on-tap
2026-07-17 20:28:46 +08:00
51064e48aa
feat: AI reply suggestions show as copyable code block, user edits before sending - Click suggestion -> show text in backtick code block (tap to copy) - Enter awaiting_reply state so user can edit/send like normal reply - No direct email sending on selection anymore - Tests: 3/3 passing
2026-07-17 20:23:59 +08:00
ab2bf7facb
feat: AI reply modes - full (formal email) and short (concise) - Split 'AI回复' button into 'AI完整回复' and 'AI简洁回复' - Full mode: complete email format with greeting/signature, 300 char limit - Short mode: brief text message style, 50 char limit - Style persists in conversation state for regen/hint consistency - Tests: 6/6 passing
2026-07-17 20:14:48 +08:00
2a9be9896f
fix: restore links when returning to summary view _summary_keyboard was called without links param in VIEW_SUMM handler, causing extracted links to disappear after viewing original text.
2026-07-17 20:10:18 +08:00
2f29e03cec
fix: read Telegram caption field for media messages Telegram sends text in 'caption' field (not 'text') when message has media. Handle both cases: text or caption, with text taking priority.
2026-07-17 20:04:27 +08:00
b2e219ece5
fix: send reply immediately on media-only message, no accumulation - Remove accumulation logic: media-only now sends as reply directly - All 3 cases (text-only, media-only, text+media) send immediately - Tests: 4/4 passing
2026-07-17 19:53:38 +08:00
131e440d6b
style: simplify media accumulation - silent accumulate, immediate send on text
2026-07-17 19:52:08 +08:00
d76a119190
feat: support attachments in manual reply (photo/video/document/voice) - Add _extract_media: extract media info from Telegram messages - Add _download_tg_file: download files from Telegram API - Modify _handle_message: accumulate attachments in awaiting_reply, send with text - Modify _handle_update: process messages without text (media-only) - Modify smtp_client.send_reply: support MIME multipart with attachments - Add comprehensive tests (11 tests, all passing)
2026-07-17 19:04:27 +08:00
d05277581c
fix: save_conversation in CALLBACK_HINT, move AI hint to thread pool
2026-07-17 18:45:40 +08:00
fe24a07d15
fix: parse_mode always MarkdownV2, add MEMORY.md with project rules
2026-07-17 18:36:53 +08:00
0abb7de5d3
fix: move regenerate to AI thread pool, fix parse_mode None error
2026-07-17 18:30:57 +08:00
5ca739456d
perf: reduce poll timeout to 1s and wait to 50ms for faster button response
2026-07-15 19:20:52 +08:00
c26d8aa294
fix: reduce long-poll timeout to 2s, make mark_as_seen async to unblock TG sender
2026-07-15 19:15:27 +08:00
687e60ede4
fix: add error logging for send_thinking failures in email poller
2026-07-15 19:02:59 +08:00
da1b266350
fix: increase Telegram long-poll timeout to 5s and HTTP timeout to 15s
2026-07-15 18:51:04 +08:00
2822075f2f
refactor: split TG worker into poller (callbacks) and sender (email summaries) threads
2026-07-15 18:35:01 +08:00
54c4bf00fb
refactor: replace all in-memory state with SQLite database
2026-07-14 14:49:23 +08:00
c3132f746a
feat: AI generates plain_text field, view full text shows readable version instead of HTML
2026-07-14 14:37:12 +08:00
dd7fc61fd4
fix: remove all body truncation, show full email text everywhere
2026-07-14 14:34:17 +08:00
26468aa43d
fix: use ellipsis character instead of dots in status messages for MarkdownV2 compatibility
2026-07-13 08:28:23 +08:00
98147e6a6c
fix: omit parse_mode from payload when None instead of sending null
2026-07-13 08:27:16 +08:00
bd5b824a6a
fix: add parse_mode param to edit_message, status messages use plain text
2026-07-13 08:23:42 +08:00
02b0941ed0
feat: two-stage status messages: 获取邮件中 -> AI思考中
2026-07-13 08:15:25 +08:00
155a6dfc53
fix: skip already-processing UIDs at FETCH level to avoid downloading email content
2026-07-13 07:35:28 +08:00
fc4c5a175c
feat: show thinking indicator during AI processing, accept non-numeric verification codes
2026-07-11 22:54:06 +08:00
13b76c00ab
feat: add tell me more button for promotion emails with AI-generated details
2026-07-11 22:17:10 +08:00
cf0f7d3956
style: restructure email formats with 收件账户 and app_name for verification
2026-07-11 22:11:15 +08:00
e56bdef0f7
fix: use single backtick for tap-to-copy, remove copy_text button
2026-07-11 22:05:02 +08:00
6d1fe29df4
fix: copy_text field must be an object with text key
2026-07-11 21:57:19 +08:00
05b15d9ee3
fix: use copy_text field instead of duplicate text key
2026-07-11 21:52:07 +08:00
03c18cdb76
fix: copy button shows only the code number
2026-07-11 21:49:54 +08:00
b835812f38
feat: add copy_text button for verification codes
2026-07-11 21:47:54 +08:00
070c32071a
style: beautify email formats with type labels and consistent layout
2026-07-11 21:42:35 +08:00
8007fa1cc4
fix: always use MarkdownV2 for all message types
2026-07-11 21:35:22 +08:00
43994d2b0d
fix: remove null parse_mode from tg payload, add error logging
2026-07-11 21:22:20 +08:00
a992af0e02
refactor: remove action_required/action_items/key_points, keep summary concise
2026-07-11 19:46:18 +08:00
1957eb2a73
feat: extract clickable links from email and show as URL buttons
2026-07-11 19:38:33 +08:00
be4e957af9
feat: verification emails displayed as platform + code
2026-07-08 16:15:51 +08:00
9991e4ef17
feat: promotional emails summarized as who promotes what
2026-07-08 16:13:54 +08:00
c684090b9c
feat: handle Reply-To header, add account_email field, decode address headers
2026-07-02 22:37:15 +08:00
ad950ff367
feat: 收件人/发件人改用邮件原始头数据
...
- sender 从 decode 改为使用原始 From 头
- 新增 recipient 字段,使用原始 To 头
- 移除 ai_process 中对 acct.username 的依赖
2026-07-02 22:04:27 +08:00
2ebcad0a70
feat: include reply content in send confirmation message
2026-07-02 21:01:05 +08:00
d334b6f3eb
feat: enhance logging detail across all modules
...
- 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)
2026-07-02 21:00:40 +08:00
be412168bb
fix: also delete user's message when cleaning up reply/hint flow
2026-07-02 20:56:30 +08:00
08a1a32367
fix: use original email From header for reply address instead of AI output
...
- send_summary now accepts original_sender (raw From header)
- Context stores original_sender separately from AI-generated sender
- _do_send_reply tries original_sender first, then AI sender fallback
2026-07-02 20:55:40 +08:00
09d11a6c03
feat: cancel button, regenerate AI replies, custom reply hints
...
- Reply prompt now has an inline '取消回复' button instead of typing text
- AI reply selection adds '换一批' button: passes all previous suggestions
to AI to generate different replies
- '我想说:' button: lets user type a hint/tone instruction, AI tailors
suggestions accordingly
- Cancel button also works on prompt/hint messages (deletes them)
- Extract _show_ai_suggestions helper for reuse
2026-07-02 20:45:40 +08:00
18db9caa8b
feat: cancel reply flow with cleanup & remove AI reply confirmation
...
- send_text now returns message_id for tracking
- Reply prompt includes cancel hint; typing '取消'/'/cancel' clears it
- Prompt message auto-deleted after reply sent or cancelled
- AI reply suggestions always send immediately on tap (no confirm step)
- Removed _confirm_keyboard, CALLBACK_CONFIRM_REPLY handler
2026-07-02 20:41:56 +08:00
3d33aeb0dd
fix: parse sender email properly & show confirmation tag clearly
...
- Use email.utils.parseaddr() to extract pure email from sender
field (was passing raw 'Name <email>' to SMTP, causing 550 error)
- AI reply selection now shows confirmation status as bold tag
on its own line for better visibility
2026-07-02 20:35:28 +08:00
0d9237ffdd
fix: handle 400 errors from Telegram callback interactions
...
- Remove redundant editMessageText in CALLBACK_REPLY (text unchanged)
- Wrap answerCallbackQuery in try/except (non-critical)
- Wrap each update in its own try/except to ensure last_update_id
always advances, preventing infinite retry loops
2026-07-02 20:32:25 +08:00