[Bug] Application description auto-populated with prompt causes 400-character limit error preventing name modification #20559

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

Originally created by @shua-chen on GitHub (Nov 26, 2025).

Originally assigned to: @crazywoola on GitHub.

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

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Create a new Agent or Chatbot application
  2. Configure the application with prompt/instruction longer than 400 characters (leave the description field empty)
  3. Save the application
  4. Navigate to the Studio
  5. Observe that the application description has been auto-populated with the prompt text
  6. Attempt to modify the application name
  7. Will get an error "Input payload validation failed"

✔️ Expected Behavior

  • The application description should remain empty if not explicitly configured, OR
  • The system should truncate the auto-populated description to fit within the 400-character limit, OR
  • Users should be able to modify the application name regardless of the description length

Actual Behavior

  • The description field is automatically filled with the full prompt text
  • If the prompt exceeds 400 characters, the application cannot be renamed unless remove the description
  • Users receive a validation error when attempting to modify the application name
Originally created by @shua-chen on GitHub (Nov 26, 2025). Originally assigned to: @crazywoola on GitHub. ### 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.9.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1. Create a new Agent or Chatbot application 2. Configure the application with prompt/instruction longer than 400 characters (leave the description field empty) 3. Save the application 4. Navigate to the Studio 5. Observe that the application description has been auto-populated with the prompt text 6. Attempt to modify the application name 7. Will get an error "Input payload validation failed" ### ✔️ Expected Behavior - The application description should remain empty if not explicitly configured, OR - The system should truncate the auto-populated description to fit within the 400-character limit, OR - Users should be able to modify the application name regardless of the description length ### ❌ Actual Behavior - The description field is automatically filled with the full prompt text - If the prompt exceeds 400 characters, the application cannot be renamed unless remove the description - Users receive a validation error when attempting to modify the application name
yindo added the 🐞 bug label 2026-02-21 20:07:57 -05:00
yindo closed this issue 2026-02-21 20:07:57 -05:00
Author
Owner

@shua-chen commented on GitHub (Nov 26, 2025):

This is easy to fix, I think modify the code under /api/models/model.py/App will work:

    @property
    def desc_or_prompt(self) -> str:
        if self.description:
            return self.description
        else:
            app_model_config = self.app_model_config
            if app_model_config:
                pre_prompt = app_model_config.pre_prompt or ""
                # Truncate to 200 characters with ellipsis if using prompt as description
                if len(pre_prompt) > 200:
                    return pre_prompt[:200] + "..."
                return pre_prompt
            else:
                return ""
@shua-chen commented on GitHub (Nov 26, 2025): This is easy to fix, I think modify the code under `/api/models/model.py/App` will work: ``` @property def desc_or_prompt(self) -> str: if self.description: return self.description else: app_model_config = self.app_model_config if app_model_config: pre_prompt = app_model_config.pre_prompt or "" # Truncate to 200 characters with ellipsis if using prompt as description if len(pre_prompt) > 200: return pre_prompt[:200] + "..." return pre_prompt else: return "" ```
Author
Owner

@dosubot[bot] commented on GitHub (Nov 26, 2025):

Your proposed change is on the right track—truncating the auto-filled description will prevent the validation error. However, the backend enforces a 400-character limit on the description field, so it's best to truncate the prompt to 400 characters (with or without an ellipsis) instead of 200 to match the actual validation logic and avoid edge cases. This way, users won't hit the "Description cannot exceed 400 characters" error when renaming or editing the app. You can see the validation logic and its consistent enforcement across the backend and frontend here: PR #23585.

Also, the desc_or_prompt property is only used for serialization and doesn't affect the stored data, so truncating here is safe and won't have side effects elsewhere in the app. Consider updating or adding unit tests to cover the new truncation logic for robustness.

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 (Nov 26, 2025): <!-- Answer --> Your proposed change is on the right track—truncating the auto-filled description will prevent the validation error. However, the backend enforces a 400-character limit on the description field, so it's best to truncate the prompt to 400 characters (with or without an ellipsis) instead of 200 to match the actual validation logic and avoid edge cases. This way, users won't hit the "Description cannot exceed 400 characters" error when renaming or editing the app. You can see the validation logic and its consistent enforcement across the backend and frontend here: [PR #23585](https://github.com/langgenius/dify/pull/23585). Also, the desc_or_prompt property is only used for serialization and doesn't affect the stored data, so truncating here is safe and won't have side effects elsewhere in the app. Consider updating or adding unit tests to cover the new truncation logic for robustness. <!-- 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/3f5aa6cf-4ba1-40a7-87d7-8f4fcc34c08e?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/3f5aa6cf-4ba1-40a7-87d7-8f4fcc34c08e?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/3f5aa6cf-4ba1-40a7-87d7-8f4fcc34c08e?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/3f5aa6cf-4ba1-40a7-87d7-8f4fcc34c08e?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/3f5aa6cf-4ba1-40a7-87d7-8f4fcc34c08e?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/3f5aa6cf-4ba1-40a7-87d7-8f4fcc34c08e?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/3f5aa6cf-4ba1-40a7-87d7-8f4fcc34c08e?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=Your%20proposed%20change%20is%20on%20the%20right%20track%E2%80%94truncating%20the%20auto-filled%20description%20will%20prevent%20the%20validation%20error.%20However%2C%20the%20backend%20enforces%20a%20400-character%20limit%20on%20the%20description%20field%2C%20so%20it%27s%20best%20to%20truncate%20the%20prompt%20to%20400%20characters%20%28with%20or%20without%20an%20ellipsis%29%20instead%20of%20200%20to%20match%20the%20actual%20validation%20logic%20and%20avoid%20edge%20cases.%20This%20way%2C%20users%20won%27t%20hit%20the%20%22Description%20cannot%20exceed%20400%20characters%22%20error%20when%20renaming%20or%20editing%20the%20app.%20You%20can%20see%20the%20validation%20logic%20and%20its%20consistent%20enforcement%20across%20the%20backend%20and%20frontend%20here%3A%20%5BPR%20%2323585%5D%28https%3A//github.com/langgenius/dify/pull/23585%29.%0A%0AAlso%2C%20the%20desc_or_prompt%20property%20is%20only%20used%20for%20serialization%20and%20doesn%27t%20affect%20the%20stored%20data%2C%20so%20truncating%20here%20is%20safe%20and%20won%27t%20have%20side%20effects%20elsewhere%20in%20the%20app.%20Consider%20updating%20or%20adding%20unit%20tests%20to%20cover%20the%20new%20truncation%20logic%20for%20robustness.)&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/28680)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#20559