Skip to content

fix(entities): add BINARY_LINK to InvokeMessage.MessageType - #385

Merged
WH-2099 merged 1 commit into
langgenius:mainfrom
Souravrajvi0:feat/add-binary-link-message-type-d824
Sep 12, 2026
Merged

WH-2099 merged 1 commit into
langgenius:mainfrom
Souravrajvi0:feat/add-binary-link-message-type-d824

Conversation

@Souravrajvi0

Copy link
Copy Markdown
Contributor

Summary

Adds the missing BINARY_LINK value to InvokeMessage.MessageType.

When Dify core's message_transformer.py converts non-image blob responses (e.g. from MCP BlobResourceContents) into tool messages, it emits type: binary_link. The SDK enum did not include this value, which caused a Pydantic validation error in agent/chat mode:

Input should be 'text', 'file', 'blob', 'json', 'link', 'image', 'image_link', ...
[type=enum, input_value='binary_link', input_type=str]

Changes

  • Add BINARY_LINK = "binary_link" to InvokeMessage.MessageType
  • Add tests verifying ToolInvokeMessage and DatasourceMessage accept binary_link payloads

Test plan

  • pytest tests/entities/test_invoke_message.py -v

Fixes #383

Dify core transforms non-image blob responses into binary_link messages,
but the SDK enum was missing this value. That caused Pydantic validation
errors when MCP tools returned BlobResourceContents in agent/chat mode.

Fixes langgenius#383
@WH-2099 WH-2099 self-assigned this Sep 12, 2026
@WH-2099
WH-2099 merged commit a501aae into langgenius:main Sep 12, 2026
4 checks passed
@WH-2099 WH-2099 mentioned this pull request Oct 8, 2026
7 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dify plugin SDK missing BINARY_LINK MessageType

2 participants