diff --git a/server/src/services/native-runtime/native-deliverable-feedback.test.ts b/server/src/services/native-runtime/native-deliverable-feedback.test.ts index f962d04454..724a0e152f 100644 --- a/server/src/services/native-runtime/native-deliverable-feedback.test.ts +++ b/server/src/services/native-runtime/native-deliverable-feedback.test.ts @@ -11,6 +11,7 @@ describe("explicit file output requirements", () => { "Do not use external services. Create a file with the results.", "Make a file but do not send it to anyone else.", "Export a summary of this PDF as CSV.", + "Create no temporary files; export the results as CSV.", ])("recognizes an explicit output request: %s", objective => { expect(explicitlyRequestsFileOutput(objective)).toBe(true); }); @@ -26,6 +27,10 @@ describe("explicit file output requirements", () => { "Write a summary of this PDF in chat.", "Create a review of README.md; reply inline.", "Give me advice on file permissions.", + "Post exactly one durable progress comment whose entire body is TRACKED, then finish this child task. Create no files and do not delegate or create any further tasks.", + "Create no files.", + "Generate no attachments and answer in chat.", + "Write a reply without any files.", ])("does not require a file for a text or source-review request: %s", objective => { expect(explicitlyRequestsFileOutput(objective)).toBe(false); }); diff --git a/server/src/services/native-runtime/native-deliverable-feedback.ts b/server/src/services/native-runtime/native-deliverable-feedback.ts index 72b3f8afeb..48aae1ace3 100644 --- a/server/src/services/native-runtime/native-deliverable-feedback.ts +++ b/server/src/services/native-runtime/native-deliverable-feedback.ts @@ -71,6 +71,9 @@ export function explicitlyRequestsFileOutput(objective: string): boolean { const fileObject = [...output.matchAll(file)].some(match => { const prefix = output.slice(0, match.index); const suffix = output.slice(match.index + match[0].length); + // "Create no files" is a prohibition, even though it contains a creation + // verb. Negate this object only; another explicit output can still count. + if (/\b(?:no|zero|without(?:\s+any)?)\s+(?:(?:new|temporary|downloadable|attached|additional)\s+)*$/iu.test(prefix)) return false; // "Write a summary of this PDF" names input, not a requested file. // Explicit export destinations still count after such input references. const destination = /\b(?:as|into|to)\s+(?:(?:a|an|the|new|separate|markdown|word|excel)\s+)*$/iu.test(prefix);