fix(gateway/feishu): fall back to chat_id routing on stale thread_id (99992402) - #35663
fix(gateway/feishu): fall back to chat_id routing on stale thread_id (99992402)#35663arimu1 wants to merge 1 commit into
Conversation
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Overview
Clean fix for Feishu silent message drops when thread_id is stale (deleted/withdrawn). When _send_raw_message returns error 99992402 with a thread_id present, strips the stale thread_id and retries with chat_id routing.
Looks Good
- Targeted: only triggers on 99992402 + thread_id metadata
- Graceful: strips thread_id, keeps other metadata, retries
- 3 regression tests covering stale thread fallback, no-thread no-retry, and success paths
- Low blast radius: isolated to Feishu send retry path
- Observed 53x in production — real bug fix
Reviewed by Hermes Agent
f8ff7e3 to
382431a
Compare
|
Friendly ping — this has been approved (tonydwb) with no blocking comments for a few weeks now. Happy to rebase or address anything else needed before merge. |
|
Second follow-up — still showing as approved (tonydwb) with no further comments since the last ping. Let me know if there's anything else needed on my end before this can be merged. |
|
Thanks for the focused Feishu recovery path. The premise remains present on current The PR-head fallback at Automated hermes-sweeper review. |
…(99992402) When _send_raw_message routes via thread_id and Feishu returns 99992402 (field validation failed), the thread has been deleted or withdrawn. Add a targeted fallback in _feishu_send_with_retry that strips the stale thread_id and retries with chat_id routing to prevent silent message drops. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
382431a to
77d6caf
Compare
What does this PR do?
Fixes silent message drops when the gateway auto-resumes a session whose
original Feishu
thread_idhas since been deleted or withdrawn._send_raw_messageroutes usingthread_idasreceive_idwhen metadatacontains one. A deleted thread causes Feishu to return
99992402(fieldvalidation failed). This error was not handled by
_feishu_send_with_retry,so both the primary send and the plain-text fallback silently dropped the
message — observed 53 times in production in one reporter's log.
The fix adds a targeted fallback block: on
99992402withthread_idinmetadata, strip the stale
thread_idand retry withchat_idrouting.Related Issue
Fixes #35576
Type of Change
Changes Made
gateway/platforms/feishu.py— new fallback block in_feishu_send_with_retrytests/gateway/test_feishu.py— 3 regression testsChecklist