When FEISHU_AUTO_THREAD=true, all Feishu replies are sent with
reply_in_thread=true, causing Feishu to automatically create a
thread for each new conversation. This isolates session context
per thread, preventing unrelated conversations from mixing and
exhausting the context window.
Implementation:
- Track last inbound message_id per chat_id in FeishuAdapter
- When auto_thread is on and no reply_to is provided, use the
tracked message_id so the reply API (which supports
reply_in_thread) is used instead of the create API
- Pass initial reply_to to GatewayStreamConsumer for streaming
replies to also land in threads
- Env var defaults to false for backward compatibility
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>