mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-07-10 16:23:44 +00:00
📏 fix: Make create_file Missing-Content Error Truncation-Aware (#14043)
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.
This commit is contained in:
parent
9f8b6d92c0
commit
927a5957cb
1 changed files with 6 additions and 1 deletions
|
|
@ -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`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue