Failed to generate prompt for Chatflow agent node #17828

Closed
opened 2026-02-21 19:40:15 -05:00 by yindo · 0 comments
Owner

Originally created by @mnasrautinno on GitHub (Sep 21, 2025).

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.8.1

Cloud or Self Hosted

Cloud

Steps to reproduce

In the cloud or self hosted versions:

  1. Create a chat flow
  2. Include agent node
  3. Run a preview chat
  4. Generate a prompt for the agent node

✔️ Expected Behavior

Prompt generated for agent node

Actual Behavior

Internal server error.

API Error Log:

 File "/app/api/core/llm_generator/llm_generator.py", line 467, in instruction_modify_workflow
    "agent_log": agent_log_of(last_run),
                 ^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/core/llm_generator/llm_generator.py", line 452, in agent_log_of
    parsed: Sequence[AgentLogEvent] = json.loads(raw_agent_log)
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/json/__init__.py", line 339, in loads
    raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not list

Snapshot:
Image

Originally created by @mnasrautinno on GitHub (Sep 21, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/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.8.1 ### Cloud or Self Hosted Cloud ### Steps to reproduce In the cloud or self hosted versions: 1. Create a chat flow 2. Include agent node 3. Run a preview chat 4. Generate a prompt for the agent node ### ✔️ Expected Behavior Prompt generated for agent node ### ❌ Actual Behavior Internal server error. API Error Log: ``` File "/app/api/core/llm_generator/llm_generator.py", line 467, in instruction_modify_workflow "agent_log": agent_log_of(last_run), ^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/core/llm_generator/llm_generator.py", line 452, in agent_log_of parsed: Sequence[AgentLogEvent] = json.loads(raw_agent_log) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/json/__init__.py", line 339, in loads raise TypeError(f'the JSON object must be str, bytes or bytearray, ' TypeError: the JSON object must be str, bytes or bytearray, not list ``` Snapshot: <img width="1655" height="914" alt="Image" src="https://github.com/user-attachments/assets/1fe840f7-542b-4ad9-a366-7251174a85e9" />
yindo added the 🤖 feat:agent label 2026-02-21 19:40:15 -05:00
yindo closed this issue 2026-02-21 19:40:15 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#17828