[PR #8395] feat: allow users to specify timeout for text generations and workflows by environment variable #26033

Closed
opened 2026-02-21 20:33:36 -05:00 by yindo · 0 comments
Owner

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

State: closed
Merged: Yes


Checklist:

Important

Please review the checklist below before submitting your pull request.

  • Please open an issue before creating a PR or link to an existing issue
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

Description

This PR allows users to specify timeout for text generations and workflows by environment variable DISABLE_UPLOAD_IMAGE_AS_ICON for web service.

  # Frontend web application.
  web:
    image: langgenius/dify-web:0.8.2
    restart: always
    environment:
      CONSOLE_API_URL: ${CONSOLE_API_URL:-}
      APP_API_URL: ${APP_API_URL:-}
      SENTRY_DSN: ${WEB_SENTRY_DSN:-}
      NEXT_TELEMETRY_DISABLED: ${NEXT_TELEMETRY_DISABLED:-0}
      TEXT_GENERATION_TIMEOUT_MS: ${TEXT_GENERATION_TIMEOUT_MS:-60000}  ✅ 

Also, new toast has been added to indicate the reason of the missing results.

image

Fixes https://github.com/langgenius/dify/issues/6449
Follow-up for https://github.com/langgenius/dify/issues/6449

Related links:

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update, included: Dify Document
  • Improvement, including but not limited to code refactoring, performance optimization, and UI/UX improvement
  • Dependency upgrade

Testing Instructions

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Remove TEXT_GENERATION_TIMEOUT_MS from docker-compose.yaml and ensure the timeout is defaulted to 60 seconds.
  • Add TEXT_GENERATION_TIMEOUT_MS to docker-compose.yaml with custom values through .env and ensure the timeout is updated by invoking long-running workflow.
  • Run long-running workflow and ensure warning toast is displayed.
**Original Pull Request:** https://github.com/langgenius/dify/pull/8395 **State:** closed **Merged:** Yes --- # Checklist: > [!IMPORTANT] > Please review the checklist below before submitting your pull request. - [x] Please open an issue before creating a PR or link to an existing issue - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods # Description This PR allows users to specify timeout for text generations and workflows by environment variable `DISABLE_UPLOAD_IMAGE_AS_ICON` for `web` service. ```yaml # Frontend web application. web: image: langgenius/dify-web:0.8.2 restart: always environment: CONSOLE_API_URL: ${CONSOLE_API_URL:-} APP_API_URL: ${APP_API_URL:-} SENTRY_DSN: ${WEB_SENTRY_DSN:-} NEXT_TELEMETRY_DISABLED: ${NEXT_TELEMETRY_DISABLED:-0} TEXT_GENERATION_TIMEOUT_MS: ${TEXT_GENERATION_TIMEOUT_MS:-60000} ✅ ``` Also, new toast has been added to indicate the reason of the missing results. ![image](https://github.com/user-attachments/assets/74e8a890-1be7-4e75-8aec-09f5119d16a5) Fixes https://github.com/langgenius/dify/issues/6449 Follow-up for https://github.com/langgenius/dify/issues/6449 Related links: - https://github.com/langgenius/dify/issues/6449 - https://github.com/langgenius/dify/issues/7295 - https://github.com/langgenius/dify/pull/6450 - https://discord.com/channels/1082486657678311454/1261378430780571808 ## Type of Change - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) - [x] Improvement, including but not limited to code refactoring, performance optimization, and UI/UX improvement - [ ] Dependency upgrade # Testing Instructions Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration - [x] Remove `TEXT_GENERATION_TIMEOUT_MS` from `docker-compose.yaml` and ensure the timeout is defaulted to 60 seconds. - [x] Add `TEXT_GENERATION_TIMEOUT_MS` to `docker-compose.yaml` with custom values through `.env` and ensure the timeout is updated by invoking long-running workflow. - [x] Run long-running workflow and ensure warning toast is displayed.
yindo added the pull-request label 2026-02-21 20:33:36 -05:00
yindo closed this issue 2026-02-21 20:33:38 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#26033