Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

📏 fix: Make `create_file` Missing-Content Error Truncation-Aware (#14043)

Danny Avila927a5957cbcd
diff --git a/packages/api/src/agents/handlers.ts b/packages/api/src/agents/handlers.ts
index 125a1a761d..e44384157f 100644
--- a/packages/api/src/agents/handlers.ts
+++ b/packages/api/src/agents/handlers.ts
@@ -2274,7 +2274,12 @@ async function handleCreateFileCall(
return errorResult(tc, 'path is required');
}
if (typeof args.content !== 'string') {
- return errorResult(tc, 'content is required');
+ return errorResult(
+ tc,
+ 'content is required. If the file is large, your response may have been cut off at the ' +
+ 'output token limit before content finished. Keep the main file lean and move bulky ' +
+ 'sections (templates, schemas, long docs) into separate files written in their own calls.',
+ );
}
if (Buffer.byteLength(args.content, 'utf8') > MAX_AUTHORING_BYTES) {
return errorResult(tc, `content exceeds ${MAX_AUTHORING_BYTES} byte limit`);