From 927a5957cbcdd59ff25bc03b674dddd426e5c40d Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Tue, 30 Jun 2026 19:31:48 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=8F=20fix:=20Make=20`create=5Ffile`=20?= =?UTF-8?q?Missing-Content=20Error=20Truncation-Aware=20(#14043)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A large SKILL.md/file authored in one create_file call can exceed the model's max output token budget; the response is cut off before the content argument finishes, the arg is dropped, and the handler returns a bare 'content is required'. The model reads that as a forgotten field and retries the same oversized write, looping. Make the error actionable: tell the model the response may have been truncated and to keep the main file lean, moving bulky sections into separate files written in their own calls. --- packages/api/src/agents/handlers.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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`);