Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: truncate auto-populated description to prevent 400-char limit error (#28681)

Shua Chen61ee1b9094ff
diff --git a/api/models/model.py b/api/models/model.py
index c8fbdc40ec3..88cb945b3f0 100644
--- a/api/models/model.py
+++ b/api/models/model.py
@@ -111,7 +111,11 @@ class App(Base):
else:
app_model_config = self.app_model_config
if app_model_config:
- return app_model_config.pre_prompt
+ 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 ""