[PR #234] feat: (sdk/python): add passthrough parameter (extends langgenius/dify#27078) #245

Open
opened 2026-02-15 21:16:24 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-plugin-sdks/pull/234
Author: @ywqwancbx
Created: 11/1/2025
Status: 🔄 Open

Base: mainHead: feature/passthrough-parameter


📝 Commits (1)

  • 6f85152 feat: support passthrough parameter across SDK with backward compatibility\n\n- Add Session.passthrough and carry through Readers (stdio/TCP/serverless)\n- Extend PluginInStream to include passthrough field\n- Wire passthrough through IOServer and Plugin into Session\n- Pass session.passthrough to Tool.invoke in PluginExecutor\n- Update Tool.invoke to accept optional passthrough, fallback on TypeError

📊 Changes

9 files changed (+35 additions, -5 deletions)

View changed files

📝 python/dify_plugin/core/entities/plugin/io.py (+14 -1)
📝 python/dify_plugin/core/plugin_executor.py (+2 -2)
📝 python/dify_plugin/core/runtime.py (+4 -0)
📝 python/dify_plugin/core/server/io_server.py (+4 -0)
📝 python/dify_plugin/core/server/serverless/request_reader.py (+1 -0)
📝 python/dify_plugin/core/server/stdio/request_reader.py (+1 -0)
📝 python/dify_plugin/core/server/tcp/request_reader.py (+1 -0)
📝 python/dify_plugin/interfaces/tool/__init__.py (+6 -2)
📝 python/dify_plugin/plugin.py (+2 -0)

📄 Description

  • Context
    • This PR extends langgenius/dify#27078 by adding passthrough parameter support to the Python plugin
      SDK, aligning with EAM-specific behavior so downstream users don’t need a custom SDK.
  • Changes
    • Add Session.passthrough and propagate via stdio/TCP/serverless readers.
    • Extend PluginInStream to carry passthrough.
    • Wire passthrough through IOServer/Plugin into Session.
    • Forward session.passthrough to Tool.invoke in PluginExecutor.
    • Backward-compatible Tool.invoke: prefer _invoke(..., passthrough=...), fallback on TypeError.
  • Compatibility
    • Backward compatible: existing tools without passthrough are unaffected.
    • No breaking changes to public APIs.
  • Related

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langgenius/dify-plugin-sdks/pull/234 **Author:** [@ywqwancbx](https://github.com/ywqwancbx) **Created:** 11/1/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feature/passthrough-parameter` --- ### 📝 Commits (1) - [`6f85152`](https://github.com/langgenius/dify-plugin-sdks/commit/6f85152da21290ee20000ef261ec8d793447b893) feat: support passthrough parameter across SDK with backward compatibility\n\n- Add Session.passthrough and carry through Readers (stdio/TCP/serverless)\n- Extend PluginInStream to include passthrough field\n- Wire passthrough through IOServer and Plugin into Session\n- Pass session.passthrough to Tool.invoke in PluginExecutor\n- Update Tool.invoke to accept optional passthrough, fallback on TypeError ### 📊 Changes **9 files changed** (+35 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `python/dify_plugin/core/entities/plugin/io.py` (+14 -1) 📝 `python/dify_plugin/core/plugin_executor.py` (+2 -2) 📝 `python/dify_plugin/core/runtime.py` (+4 -0) 📝 `python/dify_plugin/core/server/io_server.py` (+4 -0) 📝 `python/dify_plugin/core/server/serverless/request_reader.py` (+1 -0) 📝 `python/dify_plugin/core/server/stdio/request_reader.py` (+1 -0) 📝 `python/dify_plugin/core/server/tcp/request_reader.py` (+1 -0) 📝 `python/dify_plugin/interfaces/tool/__init__.py` (+6 -2) 📝 `python/dify_plugin/plugin.py` (+2 -0) </details> ### 📄 Description - Context - This PR extends langgenius/dify#27078 by adding passthrough parameter support to the Python plugin SDK, aligning with EAM-specific behavior so downstream users don’t need a custom SDK. - Changes - Add Session.passthrough and propagate via stdio/TCP/serverless readers. - Extend PluginInStream to carry passthrough. - Wire passthrough through IOServer/Plugin into Session. - Forward session.passthrough to Tool.invoke in PluginExecutor. - Backward-compatible Tool.invoke: prefer _invoke(..., passthrough=...), fallback on TypeError. - Compatibility - Backward compatible: existing tools without passthrough are unaffected. - No breaking changes to public APIs. - Related - Extends langgenius/dify#27078 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 21:16:24 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugin-sdks#245