mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix(feishu-comment): use get_hermes_home(); drop dead asyncio wrapper; AUTHOR_MAP
Follow-up polish on top of the cherry-picked #11023 commit. - feishu_comment_rules.py: replace import-time "~/.hermes" expanduser fallback with get_hermes_home() from hermes_constants (canonical, profile-safe). - tools/feishu_doc_tool.py, tools/feishu_drive_tool.py: drop the asyncio.get_event_loop().run_until_complete(asyncio.to_thread(...)) dance. Tool handlers run synchronously in a worker thread with no running loop, so the RuntimeError branch was always the one that executed. Calls client.request directly now. Unused asyncio import removed. - tests/gateway/test_feishu.py: add register_p2_customized_event to the mock EventDispatcher builder so the existing adapter test matches the new handler registration for drive.notice.comment_add_v1. - scripts/release.py: map liujinkun@bytedance.com -> liujinkun2025 for contributor attribution on release notes.
This commit is contained in:
parent
85cdb04bd4
commit
b449a0e049
5 changed files with 21 additions and 19 deletions
|
|
@ -4,7 +4,6 @@ Provides ``feishu_doc_read`` for reading document content as plain text.
|
|||
Uses the same lazy-import + BaseRequest pattern as feishu_comment.py.
|
||||
"""
|
||||
|
||||
import asyncio
|
||||
import json
|
||||
import logging
|
||||
import threading
|
||||
|
|
@ -85,13 +84,9 @@ def _handle_feishu_doc_read(args: dict, **kwargs) -> str:
|
|||
.build()
|
||||
)
|
||||
|
||||
try:
|
||||
response = asyncio.get_event_loop().run_until_complete(
|
||||
asyncio.to_thread(client.request, request)
|
||||
)
|
||||
except RuntimeError:
|
||||
# No running event loop -- call synchronously
|
||||
response = client.request(request)
|
||||
# Tool handlers run synchronously in a worker thread (no running event
|
||||
# loop), so call the blocking lark client directly.
|
||||
response = client.request(request)
|
||||
|
||||
code = getattr(response, "code", None)
|
||||
if code != 0:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue