mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-01 18:07:00 +01:00
Accept explicit inline response formats at completion
Co-authored-by: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
062902cea2
commit
63e5d6443f
4 files changed
+12
-1
No files matched your search
@@ -27,6 +27,7 @@ describe("explicit file output requirements", () => {
|
||||
"Write report.txt and provide it to me. This is an internal verification file, not a deliverable.",
|
||||
"Write report.txt and give me it. This is an internal verification file, not a deliverable.",
|
||||
"Write report.txt and return it. This is an internal verification file, not a deliverable.",
|
||||
"Write report.txt and send it as an attachment in your response. This is an internal verification file, not a deliverable.",
|
||||
])("recognizes an explicit output request: %s", objective => {
|
||||
expect(explicitlyRequestsFileOutput(objective)).toBe(true);
|
||||
});
|
||||
@@ -57,6 +58,9 @@ describe("explicit file output requirements", () => {
|
||||
"Write internal-proof.txt and return it in chat. This is an internal verification file, not a deliverable.",
|
||||
"Write internal-proof.txt and send it in chat. This is an internal verification file, not a deliverable.",
|
||||
"Write internal-proof.txt. This is an internal verification file, not a deliverable. Return it inline.",
|
||||
"Write internal-proof.txt and send it as a code block in your response. This is an internal verification file, not a deliverable.",
|
||||
"Write internal-proof.txt and return it in my reply. This is an internal verification file, not a deliverable.",
|
||||
"Write internal-proof.txt and provide it as plain text. This is an internal verification file, not a deliverable.",
|
||||
])("does not require a file for a text or source-review request: %s", objective => {
|
||||
expect(explicitlyRequestsFileOutput(objective)).toBe(false);
|
||||
});
|
||||
|
||||
@@ -93,7 +93,7 @@ export function explicitlyRequestsFileOutput(objective: string): boolean {
|
||||
const referencesOutput = /^(?:attach|export|send|provide|give|return)$/iu.test(create[0])
|
||||
&& /^\s+(?:me\s+)?(?:it|them|this|that)\b/iu.test(output);
|
||||
const referencedAttachment = referencesOutput && /^(?:attach|export)$/iu.test(create[0]);
|
||||
const inline = /\b(?:in (?:the )?chat|inline|as (?:a |the )?(?:chat )?(?:reply|message)|(?:its|the) contents)\b/iu.test(output);
|
||||
const inline = /\b(?:inline|(?:in|within|inside|as|into)\s+(?:(?:a|an|the|my|your|our|final|plain|markdown|chat|fenced)\s+)*(?:chat|response|reply|message|comment|text|code block)|(?:its|the) contents)\b/iu.test(output);
|
||||
const downloadable = referencedAttachment || (!/\b(?:no|without)\s+(?:downloadable|attached)/iu.test(output)
|
||||
&& /\b(?:downloadable|attached)\s+(?:file|report|document|checklist|draft)\b/iu.test(output));
|
||||
const publication = /\b(?:downloadable|attached|attach|export|send|provide|return|give)\b/iu.test(create[0] + output);
|
||||
|
||||
@@ -339,6 +339,7 @@ describe("native runner file handoff", () => {
|
||||
"Write internal-proof.txt; then check it exists. This is an internal verification file, not a deliverable.",
|
||||
"Attempt native write to /outside/probe.txt and create no files. This negative test must be denied.",
|
||||
"Write internal-proof.txt and return it in chat. This is an internal verification file, not a deliverable.",
|
||||
"Write internal-proof.txt and send it as a code block in your response. This is an internal verification file, not a deliverable.",
|
||||
])("accepts an internal file outcome without treating it as published output: %s", async objective => {
|
||||
await db.update(heartbeatRuns).set({ contextSnapshot: { issueId, executionContinuation: { objective } } })
|
||||
.where(eq(heartbeatRuns.id, runId));
|
||||
|
||||
Reference in new issue
Block a user