mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-22 01:55:27 -04:00
PydanticSerializationError in lark_document plugin with Feishu trigger #885
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Zane9412 on GitHub (Dec 18, 2025).
Self Checks
Dify version
1.10.1
Plugin version
0.0.2
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
✔️ Error log
An error occurred in the currently running plugin, please contact the author of currently running plugin for help,
error type: PydanticSerializationError,
error details: Unable to serialize unknown type: <class 'lark_oapi.api.drive.v1.model.bitable_table_record_action_field.BitableTableRecordActionField'>
@dosubot[bot] commented on GitHub (Dec 18, 2025):
Hi @xiezhenzhong1225! I'm Dosu and I’m helping the dify-official-plugins team.
The error happens because a Lark API model object (like BitableTableRecordActionField) is being passed to Pydantic without first converting it to a dictionary of primitive types. The event handler code for Feishu triggers in the lark_document plugin is supposed to extract fields from these objects and build plain dicts for serialization. If any branch of the code accidentally passes the raw object (instead of a dict), you'll get this error.
To fix it, review the event handler code for all Feishu triggers—especially where action_list or similar fields are processed. Make sure every action is converted to a dict of primitives before being added to the variables. Here’s a simplified example pattern you should follow:
This approach is already used in the plugin for both record and field change events, but if you have customizations or new event types, ensure you apply the same pattern everywhere you handle Lark API model objects. If you need to serialize other complex objects, consider adding helper functions similar to
serialize_user_identityorserialize_user_listfor consistency and safety.Reference: event handler code example
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other