Skip to content

Bug fix: drain in-flight Feishu messages during shutdown - #902

Open
fy17ohhh wants to merge 1 commit into
volcengine:mainfrom
fy17ohhh:fix/feishu-graceful-shutdown
Open

Bug fix: drain in-flight Feishu messages during shutdown#902
fy17ohhh wants to merge 1 commit into
volcengine:mainfrom
fy17ohhh:fix/feishu-graceful-shutdown

Conversation

@fy17ohhh

@fy17ohhh fy17ohhh commented Aug 14, 2026

Copy link
Copy Markdown

Fixes #901

Summary

Wire the AgentKit Feishu integration into FeishuChannelExtension's lifecycle so that in-flight messages can finish during application shutdown.

Previously, AgentKit maintained a separate background thread and called the wrapped SDK Channel's start() and stop() methods directly. This bypassed FeishuChannelExtension.start() and shutdown(), so message tasks were not drained when the process received SIGTERM.

Also rebinded lark_channel’s module-level WebSocket event loop to the dedicated Feishu worker loop before starting its synchronous client, preventing the this event loop is already running error message

Testing

uv run pre-commit run --all-files
uv run pytest tests/integrations/agentkit/test_app.py
uv run pytest tests/test_feishu_channel_extension.py

Behavior After This Change
image
The user can also receive the reply from Feishu bot with graceful shutdown now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AgentKit shutdown bypasses FeishuChannelExtension in-flight message draining

1 participant