langgenius / langgenius/dify

when use new agent in workflow, if passing the variable from pervious node, it cannot exceed 2000 chars.

Open Beginner friendly
#40,729 1 comment 1 reaction 0 assignees View on GitHub
🐞 bug
Dominant language
TypeScript
Stars
156k
Forks
24.6k
Avg merge
22h 9m
Merged PRs (30d)
610

Description

### 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

16.1

### Cloud or Self Hosted

Self Hosted (Docker)

### Steps to reproduce

use a long variable output from pervious node
refer the variable in the new agent, the variable output will be truncated.

### ✔️ Expected Behavior

It should not truncate user input at all.

### ❌ Actual Behavior

if over 2000 char. it will become [truncated]. And it is a hard code value in api/core/workflow/nodes/agent_v2/runtime_request_builder.py

```def _summarize_value(value: Any) -> str:
prompt_payload, used_download_mapping = WorkflowAgentRuntimeRequestBuilder._resolve_prompt_payload_value(value)
if used_download_mapping:
return json.dumps(prompt_payload, ensure_ascii=False, separators=(",", ":"))
text = str(value)
if len(text) > 2000:
return text[:2000] + "...[truncated]"
return text```

Contributor guide

Open the contributing guide

Research direction

Start in api/core/workflow/nodes/agent_v2/runtime_request_builder.py at WorkflowAgentRuntimeRequestBuilder._summarize_value and reproduce the issue with a variable output longer than 2,000 characters. Done means a long value passed from a previous node is no longer truncated to 2,000 characters or replaced with [truncated].

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.