From e38091dba71becba18e8f6478a525fe67714d16e Mon Sep 17 00:00:00 2001 From: fdc310 <2213070223@qq.com> Date: Sat, 31 Oct 2026 14:12:07 +0800 Subject: [PATCH] fix(interactions): align adapter manifests and close timed-out streams --- src/langbot/pkg/agent/runner/invoker.py | 2 ++ src/langbot/pkg/platform/adapters/dingtalk/manifest.yaml | 3 +++ src/langbot/pkg/platform/adapters/discord/manifest.yaml | 2 ++ src/langbot/pkg/platform/adapters/lark/manifest.yaml | 3 +++ src/langbot/pkg/platform/adapters/qqofficial/manifest.yaml | 2 ++ src/langbot/pkg/platform/adapters/telegram/manifest.yaml | 2 ++ src/langbot/pkg/platform/adapters/wecombot/manifest.yaml | 3 +++ 7 files changed, 17 insertions(+) diff --git a/src/langbot/pkg/agent/runner/invoker.py b/src/langbot/pkg/agent/runner/invoker.py index a32a9d8b3..53e92582a 100644 --- a/src/langbot/pkg/agent/runner/invoker.py +++ b/src/langbot/pkg/agent/runner/invoker.py @@ -114,11 +114,13 @@ class RunnerInvoker: raise except asyncio.TimeoutError: next_result.cancel() + await asyncio.gather(next_result, return_exceptions=True) await self._close_generator(gen, descriptor) raise finally: if not next_result.done(): next_result.cancel() + await asyncio.gather(next_result, return_exceptions=True) def _remaining_deadline_seconds( self, diff --git a/src/langbot/pkg/platform/adapters/dingtalk/manifest.yaml b/src/langbot/pkg/platform/adapters/dingtalk/manifest.yaml index 60b8e211f..dedf3567f 100644 --- a/src/langbot/pkg/platform/adapters/dingtalk/manifest.yaml +++ b/src/langbot/pkg/platform/adapters/dingtalk/manifest.yaml @@ -86,7 +86,10 @@ spec: - get_file_url - call_platform_api - interaction.request + - send_interaction + - get_interaction_capabilities - interaction.acknowledge + - update_interaction platform_specific_apis: - action: check_access_token diff --git a/src/langbot/pkg/platform/adapters/discord/manifest.yaml b/src/langbot/pkg/platform/adapters/discord/manifest.yaml index 0ddd1c02a..354a42961 100644 --- a/src/langbot/pkg/platform/adapters/discord/manifest.yaml +++ b/src/langbot/pkg/platform/adapters/discord/manifest.yaml @@ -65,6 +65,8 @@ spec: - leave_group - call_platform_api - interaction.request + - send_interaction + - get_interaction_capabilities platform_specific_apis: - action: get_channel diff --git a/src/langbot/pkg/platform/adapters/lark/manifest.yaml b/src/langbot/pkg/platform/adapters/lark/manifest.yaml index f13f84369..42239935c 100644 --- a/src/langbot/pkg/platform/adapters/lark/manifest.yaml +++ b/src/langbot/pkg/platform/adapters/lark/manifest.yaml @@ -266,6 +266,9 @@ spec: - call_platform_api - interaction.request - interaction.acknowledge + - send_interaction + - update_interaction + - get_interaction_capabilities platform_specific_apis: - action: check_tenant_access_token diff --git a/src/langbot/pkg/platform/adapters/qqofficial/manifest.yaml b/src/langbot/pkg/platform/adapters/qqofficial/manifest.yaml index 0b6caa430..bec35d4f4 100644 --- a/src/langbot/pkg/platform/adapters/qqofficial/manifest.yaml +++ b/src/langbot/pkg/platform/adapters/qqofficial/manifest.yaml @@ -146,6 +146,8 @@ spec: - get_group_member_info - call_platform_api - interaction.request + - send_interaction + - get_interaction_capabilities platform_specific_apis: - action: check_access_token diff --git a/src/langbot/pkg/platform/adapters/telegram/manifest.yaml b/src/langbot/pkg/platform/adapters/telegram/manifest.yaml index c54902a97..a0e60a5d9 100644 --- a/src/langbot/pkg/platform/adapters/telegram/manifest.yaml +++ b/src/langbot/pkg/platform/adapters/telegram/manifest.yaml @@ -77,6 +77,8 @@ spec: - leave_group - call_platform_api - interaction.request + - send_interaction + - get_interaction_capabilities platform_specific_apis: - action: pin_message diff --git a/src/langbot/pkg/platform/adapters/wecombot/manifest.yaml b/src/langbot/pkg/platform/adapters/wecombot/manifest.yaml index ae21b4d7d..bcf1fb12a 100644 --- a/src/langbot/pkg/platform/adapters/wecombot/manifest.yaml +++ b/src/langbot/pkg/platform/adapters/wecombot/manifest.yaml @@ -192,6 +192,9 @@ spec: - call_platform_api - interaction.request - interaction.acknowledge + - send_interaction + - update_interaction + - get_interaction_capabilities platform_specific_apis: - action: is_websocket_mode