Skip to content

fix(web): clear responding state when annotation reply ends without workflow events#37365

Closed
leslie2046 wants to merge 7 commits into
langgenius:mainfrom
leslie2046:message-end
Closed

fix(web): clear responding state when annotation reply ends without workflow events#37365
leslie2046 wants to merge 7 commits into
langgenius:mainfrom
leslie2046:message-end

Conversation

@leslie2046

@leslie2046 leslie2046 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

fixes #37362

Summary

This PR fixes a UI state issue where the response may remain in the responding state after an Annotation Reply finishes.

The issue affected both:

  • shared/web chat
  • console debug/preview

Root Cause

In the annotation reply fast path, the SSE stream may end with message_end without ever starting a workflow.

Previously, the frontend mainly relied on workflow lifecycle events to clear the responding state, so the UI could keep showing "Stop responding" even though the response had already finished.

Fix

  • treat message_end as a terminal signal when the current response never entered workflow state
  • keep the existing behavior unchanged for normal workflow runs that do emit workflow events

Tests

Added targeted test coverage for:

  • app/components/base/chat/chat/__tests__/hooks.spec.tsx
  • app/components/workflow/panel/debug-and-preview/__tests__/hooks/sse-callbacks.spec.ts

Not run locally.

From gpt-5.5 codex

Screenshots

Before After
... ...

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 && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jun 12, 2026
@github-actions github-actions Bot added the web This relates to changes on the web. label Jun 12, 2026
@leslie2046 leslie2046 closed this Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Web UI / Console keeps showing "Stop responding" when Annotation Reply ends without workflow events

1 participant