Commit Graph

43 Commits

Author SHA1 Message Date
chengyongru
4044b85d4b fix: ensure feishu audio file has .opus extension for Groq Whisper compatibility 2026-03-09 01:32:10 +08:00
Re-bin
20dfaa5d34 refactor: unify instance path resolution and preserve workspace override 2026-03-08 02:58:25 +00:00
Re-bin
4021f5212c Merge main into pr-332 2026-03-07 15:02:06 +00:00
chengyongru
215360113f feat(feishu): add audio transcription support using Groq Whisper 2026-03-07 16:21:52 +08:00
Re-bin
645e30557b Merge remote-tracking branch 'origin/main' into pr-1605 2026-03-06 06:00:32 +00:00
PiKaqqqqqq
c3526a7fdb fix(feishu): smart message format selection (fixes #1548)
Instead of always sending interactive cards, detect the optimal
message format based on content:
- text: short plain text (≤200 chars, no markdown)
- post: medium text with links (≤2000 chars)
- interactive: complex content (code, tables, headings, bold, lists)
2026-03-06 10:11:53 +08:00
pikaqqqqqq
5ced08b1f2 fix(feishu): use msg_type "media" for mp4 video files
Previously, mp4 video files were sent with msg_type "file", which meant
users had to download them to play. Feishu requires msg_type "media" for
audio and video files to enable inline playback in the chat.

Changes:
- Add _VIDEO_EXTS constant for video file extensions (.mp4, .mov, .avi)
- Use msg_type "media" for both audio (_AUDIO_EXTS) and video (_VIDEO_EXTS)
- Keep msg_type "file" for documents and other file types

The upload_file API already uses file_type="mp4" for video files via the
existing _FILE_TYPE_MAP, so only the send msg_type needed fixing.
2026-03-06 01:54:00 +08:00
Re-bin
573fc7cd95 Merge remote-tracking branch 'origin/main' into pr-1384 2026-03-05 15:19:50 +00:00
coldxiangyu
97522bfa03 fix(feishu): isolate lark ws Client event loop from main asyncio loop
Commit 0209ad5 moved `import lark_oapi as lark` inside the start()
method (lazy import) to suppress DeprecationWarnings. This had an
unintended side effect: the import now happens after the main asyncio
loop is already running, so lark_oapi's module-level

    loop = asyncio.get_event_loop()

captures the running main loop. When the WebSocket thread then calls
loop.run_until_complete() inside Client.start(), Python raises:

    RuntimeError: This event loop is already running

and the _connect/_disconnect coroutines are never awaited.

Fix: in run_ws(), create a fresh event loop with asyncio.new_event_loop(),
set it as the thread's current loop, and patch lark_oapi.ws.client.loop
to point to this dedicated loop before calling Client.start(). The loop
is closed on thread exit.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-03-05 17:27:17 +08:00
Sergio Sánchez Vallés
e032faaeff Merge branch 'main' of upstream/main into fix/test-failures 2026-03-04 20:04:00 +01:00
Sergio Sánchez Vallés
0209ad57d9 fix(tests): resolve RequestsDependencyWarning and lark-oapi asyncio/websockets DeprecationWarnings 2026-03-04 19:31:39 +01:00
zerone0x
8571df2e63 fix(feishu): split card messages when content has multiple tables
Feishu rejects interactive cards that contain more than one table element
(API error 11310: card table number over limit).

Add FeishuChannel._split_elements_by_table_limit() which partitions the flat
card-elements list into groups of at most one table each.  The send() method
now iterates over these groups and sends each as its own card message, so all
tables are delivered to the user instead of the entire message being dropped.

Single-table and table-free messages are unaffected (one card, same as before).

Fixes #1382
2026-03-01 15:13:44 +01:00
Re-bin
4752e95a24 merge origin/main into pr-1361 2026-03-01 06:36:29 +00:00
Re-bin
c2bbd6d20d Merge branch 'main' into pr-1361 2026-03-01 06:30:10 +00:00
Jack Lu
3ee061b879 Merge branch 'main' into main 2026-03-01 13:35:24 +08:00
yzchen
2fc16596d0 fix(feishu): parse post wrapper payload for rich text messages 2026-03-01 02:17:10 +08:00
Xubin Ren
422969d468 Merge PR #1348: fix(lark): Remove non-existent stop() call on Lark ws.Client when enable lark channel
fix(lark): Remove non-existent stop() call on Lark ws.Client when enable lark channel
2026-03-01 01:23:27 +08:00
zhangxiaoyu.york
9e2f69bd5a tidy up 2026-03-01 00:51:17 +08:00
zhangxiaoyu.york
5d829ca575 bugfix: remove client.stop 2026-03-01 00:30:03 +08:00
zhangxiaoyu.york
b3af59fc8e bugfix: remove client.stop 2026-03-01 00:20:32 +08:00
JK_Lu
977ca725f2 style: unify code formatting and import order
- Remove trailing whitespace and normalize blank lines
- Unify string quotes and line breaks for long lines
- Sort imports alphabetically across modules
2026-02-28 20:55:43 +08:00
阿正
e440aa72c5 fix the interactive message text cannot be extracted 2026-02-28 15:10:35 +08:00
kimkitsuragi26
6641bad337 feat(feishu): make reaction emoji configurable
Replace hardcoded THUMBSUP with configurable react_emoji field
in FeishuConfig, consistent with SlackConfig.react_emoji pattern.

Default remains THUMBSUP for backward compatibility.
2026-02-27 11:45:44 +08:00
xzq.xu
4f8033627e feat(feishu): support images in post (rich text) messages
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-24 13:42:07 +08:00
Re-bin
efe89c9091 fix(feishu): pass msg_type as resource_type and clean up style 2026-02-22 18:16:45 +00:00
FloRa
0d3a2963d0 fix(feishu): replace file.get with message_resource.get to fix file download permission issue 2026-02-22 17:37:33 +08:00
FloRa
973061b01e fix(feishu): replace file.get with message_resource.get to fix file download permission issue 2026-02-22 17:15:00 +08:00
Re-bin
8125d9b6bc fix(feishu): fix double recursion, English placeholders, top-level Path import 2026-02-21 06:30:26 +00:00
coldxiangyu
b9c3f8a5a3 feat(feishu): add share card and interactive message parsing
- Add content extraction for share cards (chat, user, calendar event)
- Add recursive parsing for interactive card elements
- Fix image download API to use GetMessageResourceRequest with message_id
- Handle BytesIO response from message resource API

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-02-21 14:08:25 +08:00
coldxiangyu
98ef57e370 feat(feishu): add multimedia download support for images, audio and files
Add download functionality for multimedia messages in Feishu channel,
enabling agents to process images, audio recordings, and file attachments
sent through Feishu.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 12:56:57 +08:00
Re-bin
73fdd0dd45 fix: complete ensure_ascii=False and UTF-8 encoding migration 2026-02-20 07:59:32 +00:00
Re-bin
37252a4226 fix: complete loguru native formatting migration across all files 2026-02-20 07:55:34 +00:00
Nikolas de Hor
53b83a38e2 fix: use loguru native formatting to prevent KeyError on messages containing curly braces
Closes #857
2026-02-19 17:19:36 -03:00
Re-bin
3890f1a7dd refactor(feishu): clean up send() and remove dead code 2026-02-19 17:33:08 +00:00
Ubuntu
d08c022255 feat(feishu): support sending images, audio, and files
- Add image upload via im.v1.image.create API
- Add file upload via im.v1.file.create API
- Support sending images (.png, .jpg, .gif, etc.) as image messages
- Support sending audio (.opus) as voice messages
- Support sending other files as file messages
- Refactor send() to handle media attachments before text content
2026-02-19 16:31:00 +08:00
Ahwei
5e082690d8 refactor(feishu): support both direct and localized post content formats 2026-02-14 14:37:23 +08:00
Ahwei
4e4eb21d23 feat(feishu): Add rich text message content extraction feature
Newly added the _extract_post_text function to extract plain text content from Feishu rich text messages, supporting the parsing of titles, text, links, and @mentions.
2026-02-14 12:14:31 +08:00
Ahwei
ccf9a6c146 fix(feishu): convert markdown headings to div elements in card messages
Markdown heading syntax (#) is not properly rendered in Feishu interactive
cards. Convert headings to div elements with lark_md format (bold text) for
proper display.

- Add _HEADING_RE regex to match markdown headings (h1-h6)
- Add _split_headings() method to parse and convert headings to div elements
- Update _build_card_elements() to process headings before markdown content
2026-02-13 15:31:30 +08:00
Re-bin
b429bf9381 fix: improve long-running stability for various channels 2026-02-12 01:20:57 +00:00
tao.jun
59017aa9bb feat(feishu): Add event handlers for reactions, message read, and p2p chat events
- Register handlers for message reaction created events
- Register handlers for message read events
- Register handlers for bot entering p2p chat events
- Prevent error logs for these common but unprocessed events
- Import required event types from lark_oapi
2026-02-08 13:03:32 +08:00
Re-bin
2ca15f2a9d feat: enhance Feishu markdown rendering 2026-02-07 09:46:53 +00:00
Re-bin
50a4c4ca1a refactor: improve feishu channel implementation 2026-02-05 06:01:02 +00:00
tao.jun
50fa024ab4 feishu support 2026-02-04 14:07:45 +08:00