Repository navigation
fix(openai_api_compatible): wire up the orphaned stream_function_calling credential - #4068
warwolf996 wants to merge 2 commits into
Conversation
6a2113e to
ec5fe50
Compare
|
Thanks @dosu — confirming all three points:
|
|
Thanks for confirming and correcting the method name. Please add the three schema-level unit tests you outlined:
Keep the manual end-to-end verification in the PR description, clearly distinguished from the automated schema tests. |
ec5fe50 to
6e7b85b
Compare
|
Follow-up on the coverage point: added |
|
@crazywoola could you take a look when you have a chance? You reviewed the recent |
|
Hi @warwolf996, thanks for wiring up the orphaned Heads-up about Thanks again! 🙏 |
…ing credential The stream_function_calling credential has been present in the credential form since langgenius#3467, where it gated the STREAM_TOOL_CALL feature in the legacy model runtime, but it was never read after the plugin migration. Read it again in get_customizable_model_schema so agent strategies (e.g. Function Calling) stream model invocations instead of blocking on the full response. Keep the form default (not_supported) so existing behavior is unchanged unless explicitly enabled per credential.
Bump the plugin version to the next unused one (main is at 0.0.73) so this fix does not collide with other pending openai_api_compatible PRs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
6e7b85b to
4221fd1
Compare
|
Hi @crazywoola, thanks for the heads-up! Done in 4221fd1:
The schema-level unit tests requested earlier are already in place ( |
Summary
stream_function_callingcredential inget_customizable_model_schema(): when set tosupported, the provider declaresModelFeature.STREAM_TOOL_CALL.not_supported), so existing behavior is unchanged unless explicitly enabled per credential.Closes #4067
Root cause
stream_function_callingwas introduced in langgenius/dify#3467 for the legacy built-in model runtime, where it appendedModelFeature.STREAM_TOOL_CALLto the model features when enabled. During the plugin migration (langgenius/dify#13836) the credential form field was carried over to this repo's yaml and the Agent-side feature check was carried over to the agent strategy plugin, but the feature-declaration wiring was not ported to the plugin'sget_customizable_model_schema()— leaving the setting dead and Agent calls permanently non-streaming. Full timeline in #4067.Impact of the fix
When the credential is enabled, agent strategies (e.g. Function Calling) stream model invocations. Besides earlier first tokens, streaming bounds the HTTP read timeout to the gap between SSE chunks instead of the full generation time, which prevents
ReadTimeout/ 504 failures on long generations with reasoning models.Verification
Automated (schema-level) —
tests/test_stream_tool_call_feature.pycovers four cases: explicitsupporteddeclaresSTREAM_TOOL_CALL;not_supportedand omitted credentials omit it; an existing declaration is not duplicated. The key case fails on unfixedmainand passes with the fix.Manual (end-to-end) — tested on Dify 1.17.1 with langgenius/agent 0.0.50 and a DeepSeek endpoint (
function_calling_type = tool_call):stream_function_calling = supported→ Agent model calls switch to streaming, including full tool-calling chains (streamed tool-call deltas are aggregated by the SDK and parallel tool calls work)Release Notes
Wire up the orphaned
stream_function_callingcredential: when set to Support, the provider now declares the stream-tool-call capability so Agent strategies (e.g. Function Calling) stream model invocations instead of blocking on the full response — restoring the behavior introduced in langgenius/dify#3467 that was lost during the plugin migration.