[PR #31193] feat: add first token timeout support for LLM node retry mechanism #33128

Open
opened 2026-02-21 20:52:42 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/31193

State: open
Merged: No


Summary

Fixes #31187
This PR introduces a configurable first token timeout option for LLM-related workflow nodes (LLM, Agent, Parameter Extractor, Question Classifier), allowing users to set a maximum wait time for the first streaming response token. When enabled alongside retry, this timeout triggers automatic retries if the LLM service fails to respond within the specified duration, enhancing workflow resilience against slow or unresponsive model providers.

Screenshots

Before After
... image image

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint and make type-check (backend) and cd web && npx lint-staged (frontend) to appease the lint gods
**Original Pull Request:** https://github.com/langgenius/dify/pull/31193 **State:** open **Merged:** No --- ## Summary Fixes #31187 This PR introduces a configurable first token timeout option for LLM-related workflow nodes (LLM, Agent, Parameter Extractor, Question Classifier), allowing users to set a maximum wait time for the first streaming response token. When enabled alongside retry, this timeout triggers automatic retries if the LLM service fails to respond within the specified duration, enhancing workflow resilience against slow or unresponsive model providers. ## Screenshots | Before | After | |--------|-------| | ... | <img width="595" height="700" alt="image" src="https://github.com/user-attachments/assets/4f24d486-4ab8-42da-b3eb-6004fa47ace2" /> <img width="1461" height="509" alt="image" src="https://github.com/user-attachments/assets/699be62f-c983-4fc1-810c-4e0684d30067" />| ## Checklist - [ ] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) - [x] I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!) - [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change. - [x] I've updated the documentation accordingly. - [x] I ran `make lint` and `make type-check` (backend) and `cd web && npx lint-staged` (frontend) to appease the lint gods
yindo added the pull-request label 2026-02-21 20:52:42 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#33128