Bug description
When Hermes sends an outbound audio message to Feishu/Lark, the message can play normally but may show an incorrect duration (for example 0s).
In local testing, the problem appears specifically on the upload step for outbound audio files: the Feishu SDK upload body supports a duration field, but Hermes does not currently pass it when uploading audio before sending the audio message.
Steps to reproduce
- Configure Hermes with a working Feishu/Lark gateway.
- Generate or provide an outbound audio file (for example
.ogg / .opus).
- Send it through the Feishu adapter as an outbound audio message.
- Observe the message in Feishu.
Expected behavior
The outbound audio message should display the correct duration metadata in Feishu/Lark.
Actual behavior
The audio can be playable, but the duration metadata may be missing or displayed incorrectly (for example 0s).
Root cause
In gateway/platforms/feishu.py, outbound audio upload currently builds CreateFileRequestBody with fields like:
But the Feishu SDK also supports duration on CreateFileRequestBody for audio uploads.
In local verification:
- manually uploading the same audio with
duration=<milliseconds> made Feishu return/send the audio message with the correct duration
- patching Hermes locally to probe audio duration and pass it into the upload body also worked
Suggested fix
When the resolved outbound message type is audio:
- probe the local audio duration in milliseconds
- pass
duration into CreateFileRequestBody
- upload the file as usual, then send the
audio message with the returned file_key
A minimal local patch in gateway/platforms/feishu.py was enough to fix this in testing.
Environment
- Hermes repo:
NousResearch/hermes-agent
- Platform: Feishu/Lark
- OS tested: Ubuntu 24.04 under WSL
If helpful, I can open a follow-up PR with the small Feishu adapter fix.
Bug description
When Hermes sends an outbound audio message to Feishu/Lark, the message can play normally but may show an incorrect duration (for example
0s).In local testing, the problem appears specifically on the upload step for outbound audio files: the Feishu SDK upload body supports a
durationfield, but Hermes does not currently pass it when uploading audio before sending theaudiomessage.Steps to reproduce
.ogg/.opus).Expected behavior
The outbound audio message should display the correct duration metadata in Feishu/Lark.
Actual behavior
The audio can be playable, but the duration metadata may be missing or displayed incorrectly (for example
0s).Root cause
In
gateway/platforms/feishu.py, outbound audio upload currently buildsCreateFileRequestBodywith fields like:file_typefile_namefileBut the Feishu SDK also supports
durationonCreateFileRequestBodyfor audio uploads.In local verification:
duration=<milliseconds>made Feishu return/send the audio message with the correct durationSuggested fix
When the resolved outbound message type is
audio:durationintoCreateFileRequestBodyaudiomessage with the returnedfile_keyA minimal local patch in
gateway/platforms/feishu.pywas enough to fix this in testing.Environment
NousResearch/hermes-agentIf helpful, I can open a follow-up PR with the small Feishu adapter fix.