Can I set CODE_MAX_STRING_LENGTH in .env from 80000 to 800000 #21335

Closed
opened 2026-02-21 20:12:01 -05:00 by yindo · 2 comments
Owner

Originally created by @fanfan-lucky on GitHub (Dec 29, 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.2.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Modify CODE_MAX_STRING_LENGTH from 80000 to 800000

✔️ Expected Behavior

what is the maxinum value that I can set?

Actual Behavior

No response

Originally created by @fanfan-lucky on GitHub (Dec 29, 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.2.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Modify CODE_MAX_STRING_LENGTH from 80000 to 800000 ### ✔️ Expected Behavior what is the maxinum value that I can set? ### ❌ Actual Behavior _No response_
yindo added the 🙋‍♂️ question label 2026-02-21 20:12:01 -05:00
yindo closed this issue 2026-02-21 20:12:01 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 29, 2025):

You can increase CODE_MAX_STRING_LENGTH in your .env file, but the only documented value in the Dify repo is 400000, as shown in the .env.example file. There are no hardcoded limits in the codebase, so technically you can set it higher, such as 800000. However, the actual upper bound may depend on the sandbox service implementation and your system's available resources. Be aware that setting a much higher value could impact performance or memory usage, so test carefully in your environment.
Reference: .env.example

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Dec 29, 2025): <!-- Answer --> You can increase CODE_MAX_STRING_LENGTH in your .env file, but the only documented value in the Dify repo is 400000, as shown in the .env.example file. There are no hardcoded limits in the codebase, so technically you can set it higher, such as 800000. However, the actual upper bound may depend on the sandbox service implementation and your system's available resources. Be aware that setting a much higher value could impact performance or memory usage, so test carefully in your environment. [Reference: .env.example](https://github.com/langgenius/dify/blob/0b1439fee432579e7b023f4ba2554d2916028493/docker/.env.example#L987-L991) <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/1969bc88-164b-4b06-bed1-8ad5c22e44b6?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/1969bc88-164b-4b06-bed1-8ad5c22e44b6?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/1969bc88-164b-4b06-bed1-8ad5c22e44b6?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/1969bc88-164b-4b06-bed1-8ad5c22e44b6?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/1969bc88-164b-4b06-bed1-8ad5c22e44b6?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/1969bc88-164b-4b06-bed1-8ad5c22e44b6?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/1969bc88-164b-4b06-bed1-8ad5c22e44b6?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=You%20can%20increase%20CODE_MAX_STRING_LENGTH%20in%20your%20.env%20file%2C%20but%20the%20only%20documented%20value%20in%20the%20Dify%20repo%20is%20400000%2C%20as%20shown%20in%20the%20.env.example%20file.%20There%20are%20no%20hardcoded%20limits%20in%20the%20codebase%2C%20so%20technically%20you%20can%20set%20it%20higher%2C%20such%20as%20800000.%20However%2C%20the%20actual%20upper%20bound%20may%20depend%20on%20the%20sandbox%20service%20implementation%20and%20your%20system%27s%20available%20resources.%20Be%20aware%20that%20setting%20a%20much%20higher%20value%20could%20impact%20performance%20or%20memory%20usage%2C%20so%20test%20carefully%20in%20your%20environment.%20%20%0A%5BReference%3A%20.env.example%5D%28https%3A//github.com/langgenius/dify/blob/0b1439fee432579e7b023f4ba2554d2916028493/docker/.env.example%23L987-L991%29)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/30307)
Author
Owner

@crazywoola commented on GitHub (Dec 29, 2025):

This is only for bug report, if you would like to ask a question, please head to Discussions.

@crazywoola commented on GitHub (Dec 29, 2025): 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).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#21335