dify icon indicating copy to clipboard operation
dify copied to clipboard

Human input does not show response text from LLM

Open mateusz91t opened this issue 5 months ago • 6 comments

Self Checks

  • [x] I have read the Contributing Guide and Language Policy.
  • [x] This is only for bug report, if you would like to ask a question, please head to Discussions.
  • [x] I have searched for existing issues search for existing issues, including closed ones.
  • [x] I confirm that I am using English to submit this report, otherwise it will be closed.
  • [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • [x] Please do not modify this template :) and fill in all the required fields.

Dify version

1.14.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Checked in the Chrome and Edge browsers.

Add a chatflow with nodes:

  1. User Input
  2. LLM
  3. Human Input: add llm text answer to Form Content in the node
  4. Answer

eg:

Image

Run App and write prompt, eg:

Image

Now we can see the answer, but it will disappear. To show the disappearing answer bug in the Human Input node there are 2 ways (as far as I know):

  1. Change the browser tab and come back to this App after ~ 10 minutes. OR
  2. Regenerate the answer, change answer to the first and next change to the second. Now both answers disappeared and we can see the {{#llm.text#}} placeholder instead.

✔️ Expected Behavior

  1. Human input should refresh the last displayed text when you return after a few minutes to browser tab with the chat.
  2. Human input should provide the ability to switch between response versions.

❌ Actual Behavior

Before regenerate:

Image

Regenerate in progress...:

Image

After regenerate:

Image

When you regenerate and switch answer version to the first:

Image

When you regenerate and switch to the second version of answer:

Image

When you return to this browser tab after 10 minutes:

Image

mateusz91t avatar Jun 17 '26 10:06 mateusz91t

I'd like to work on this. Understanding: the resolved {{#llm.text#}} text displays correctly right after the LLM responds, but reverts to the raw placeholder either after the tab sits inactive for ~10 min, or after switching between regenerated answer versions — suggesting the frontend loses/doesn't re-resolve the variable from state on re-render, not a backend issue.

Plan: reproduce locally with the same chatflow (User Input → LLM → Human Input → Answer), trace how the Human Input node resolves and caches {{#llm.text#}}, focus on the answer-version switcher and whatever triggers re-render on tab-focus return (websocket reconnect / stale state / re-fetch not carrying the LLM output forward), then fix + PR.

Let me know if someone's already on this or if there's relevant context on the Human Input node I should know first.

aashishkumar-tech avatar Jun 17 '26 15:06 aashishkumar-tech

Hi, @mateusz91t. I'm Dosu, and I'm helping the dify team manage their backlog and am marking this issue as stale.

Issue Summary

  • You reported that in Dify 1.14.2, a Chatflow with a Human Input node can intermittently lose the LLM-generated text and fall back to showing the raw {{#llm.text#}} placeholder.
  • The behavior appears after some time or when regenerating an answer, which suggests the displayed value is not being preserved reliably.
  • In the discussion, @aashishkumar-tech indicated they want to investigate and suspect the problem is frontend state/rendering related rather than backend.
  • The likely focus is on how the Human Input node re-resolves or caches {{#llm.text#}}, especially after tab inactivity or answer-version switching.

Next Steps

  • Please let us know if this is still relevant on the latest version of the dify repository; if so, you can keep the discussion open by commenting here.
  • Otherwise, this issue will be automatically closed in 15 days.

Thanks for your understanding and contribution.

dosubot[bot] avatar Jul 24 '26 16:07 dosubot[bot]

I found an workaround - use HTML buttons instead of human input. HI feature still has bugs as above described.

mateusz91t avatar Jul 25 '26 08:07 mateusz91t

@crazywoola The issue is still relevant: @mateusz91t reported a workaround by using HTML buttons instead of the Human Input node, but confirmed the Human Input feature still has the bugs described above. Could you please take a look when you have a chance?

dosubot[bot] avatar Jul 25 '26 08:07 dosubot[bot]

For v1 Human Input forms, current main provides a useful diagnostic boundary: the history repository builds form_definition.form_content from the stored form.rendered_content, and groups the extra content by message ID.

Compare the form text received initially with the reloaded history payload for the same message. If the history payload already contains {{#llm.text#}}, trace persistence/history mapping; if it still contains the resolved answer, focus on the client’s history restoration. A regeneration regression should check each answer’s own message/form association, since the node ID alone is shared between runs.

This can be checked locally without posting form tokens or private LLM output. The reference below is current-source review; I haven’t reproduced this on the reported 1.14.2 deployment: https://github.com/langgenius/dify/blob/7e15fac03242a9e6a3a1e5010b06956c7aa101a2/api/repositories/sqlalchemy_execution_extra_content_repository.py#L52-L153

xz567001-afk avatar Oct 30 '26 06:10 xz567001-afk

I verified this against current main and can no longer reproduce the placeholder fallback on the API replay path.

What changed: since the Graphon 0.8 execution refactor (#40277, merged 2026-10-19), pause reasons are no longer replayed from the pause-reason template:

  • At pause time, WorkflowRunAgg._persist_pause builds the persisted HumanInputRequired reasons from the form record (build_human_input_pause_reason), so form_content is the rendered HumanInputForm.rendered_content and resolved_default_values are the values resolved at form creation.
  • On reconnect, DifyAPISQLAlchemyWorkflowRunRepository.get_workflow_pause re-hydrates the reasons from the human_input_forms row (_hydrate_pause_reasons → _build_human_input_required_reason), preferring form_model.rendered_content over definition.form_content, so {{#llm.text#}} cannot reappear after a refresh. The snapshot service (workflow_event_snapshot_service) then replays exactly those hydrated reasons.

I confirmed this end-to-end with a SQLite round-trip (persist WorkflowPause + HITL pause reason + form with rendered_content/default_values → get_workflow_pause → _build_snapshot_events): both the replayed human_input_required event and the workflow_paused reasons carry the rendered text, while the un-hydrated reason row alone carries none.

Since this issue is labeled 1.14.0, could you re-check on a build containing #40277 (or the next release)? If it still reproduces there, please share the chatflow shape and I can dig further — otherwise this can be closed.

heyseere avatar Oct 30 '26 16:10 heyseere