Skip to content

Human input does not show response text from LLM #37588

Open

Description

@mateusz91t

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • 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

Activity

  1. aashishkumar-tech commented on Jun 17, 2026

    @aashishkumar-tech

    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.

  2. added
    1.14.0
    on Jun 23, 2026
  3. dosubot commented on Jul 24, 2026

    @dosubot

    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.

  4. mateusz91t commented on Jul 25, 2026

    @mateusz91t
    Author

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

  5. dosubot commented on Jul 25, 2026

    @dosubot

    @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?

  6. added
    🐞 bug
    and removed on Sep 4, 2026
  7. xz567001-afk commented on Oct 30, 2026

    @xz567001-afk

    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:

    def get_by_message_ids(self, message_ids: Sequence[str]) -> list[list[StoredExecutionExtraContent]]:
    if not message_ids:
    return []
    grouped_contents: dict[str, list[StoredExecutionExtraContent]] = {message_id: [] for message_id in message_ids}
    stmt = (
    select(ExecutionExtraContentModel)
    .where(ExecutionExtraContentModel.message_id.in_(message_ids))
    .options(selectinload(HumanInputContentModel.form))
    .order_by(ExecutionExtraContentModel.created_at.asc())
    )
    with self._session_maker() as session:
    results = session.scalars(stmt).all()
    form_ids = {
    content.form_id
    for content in results
    if isinstance(content, HumanInputContentModel) and content.form_id is not None
    }
    recipients_by_form_id: dict[str, list[HumanInputFormRecipient]] = defaultdict(list)
    if form_ids:
    recipient_stmt = select(HumanInputFormRecipient).where(HumanInputFormRecipient.form_id.in_(form_ids))
    recipients = session.scalars(recipient_stmt).all()
    for recipient in recipients:
    recipients_by_form_id[recipient.form_id].append(recipient)
    else:
    recipients_by_form_id = {}
    for content in results:
    message_id = content.message_id
    if not message_id or message_id not in grouped_contents:
    continue
    domain_model = self._map_model_to_domain(content, recipients_by_form_id)
    if domain_model is None:
    continue
    grouped_contents[message_id].append(domain_model)
    return [grouped_contents[message_id] for message_id in message_ids]
    def _map_model_to_domain(
    self,
    model: ExecutionExtraContentModel,
    recipients_by_form_id: dict[str, list[HumanInputFormRecipient]],
    ) -> StoredExecutionExtraContent | None:
    if isinstance(model, HumanInputContentModel):
    # V2 forms live in a separate repository. Preserve their references
    # so the service can restore presentation and initiator access.
    if model.form is None:
    return HumanInputFormReference(workflow_run_id=model.workflow_run_id, form_id=model.form_id)
    return self._map_human_input_content(model, recipients_by_form_id)
    logger.debug("Unsupported execution extra content type encountered: %s", model.type)
    return None
    def _map_human_input_content(
    self,
    model: HumanInputContentModel,
    recipients_by_form_id: dict[str, list[HumanInputFormRecipient]],
    ) -> HumanInputContentDomainModel | None:
    form = model.form
    if form is None:
    logger.warning("HumanInputContent(id=%s) has no associated form loaded", model.id)
    return None
    try:
    definition_payload = json.loads(form.form_definition)
    if "expiration_time" not in definition_payload:
    definition_payload["expiration_time"] = form.expiration_time
    form_definition = FormDefinition.model_validate(definition_payload)
    except ValueError:
    logger.warning("Failed to load form definition for HumanInputContent(id=%s)", model.id, exc_info=True)
    return None
    node_title = form_definition.node_title or form.node_id
    display_in_ui = bool(form_definition.display_in_ui)
    submitted = form.submitted_at is not None or form.status == HumanInputFormStatus.SUBMITTED
    # Only a waiting form can still be answered; a timed-out or expired one gets no token.
    answerable = not submitted and form.status == HumanInputFormStatus.WAITING
    form_token = self._resolve_form_token(recipients_by_form_id.get(form.id, [])) if answerable else None
    form_definition_domain_model = HumanInputFormDefinition(
    form_id=form.id,
    node_id=form.node_id,
    node_title=node_title,
    form_content=form.rendered_content,
    inputs=form_definition.inputs,
    actions=form_definition.user_actions,
    display_in_ui=display_in_ui,
    form_token=form_token,
    resolved_default_values=form_definition.default_values,
    expiration_time=int(form.expiration_time.timestamp()),
    )
    if not submitted:
    return HumanInputContentDomainModel(
    workflow_run_id=model.workflow_run_id,
    submitted=False,
    form_definition=form_definition_domain_model,
    )

  8. heyseere commented on Oct 30, 2026

    @heyseere
    Contributor

    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.

  9. added
    1.14.2
    on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    1.14.01.14.2project#dify🐞 bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions