From 4eedea7ff224e5804092f1c87338e6a8a259e44a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 4 Aug 2026 17:34:18 +0000 Subject: [PATCH 1/2] Initial plan From 7e1a7487786db8564763f4d2f65a437ceb558146 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 4 Aug 2026 17:36:37 +0000 Subject: [PATCH 2/2] fix: bound image request matcher input Co-authored-by: scarolan <403332+scarolan@users.noreply.github.com> --- lib/responses.js | 7 +++++-- test/responses.test.js | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/responses.js b/lib/responses.js index f44e605..2712011 100644 --- a/lib/responses.js +++ b/lib/responses.js @@ -112,8 +112,11 @@ export const RICKROLL_BLOCKS = { export function isImageRequest(text) { if (!text) return false; - return /(?:can you |could you |please |)(?:create|generate|make|draw).+(?:image|picture|drawing|illustration)/i.test( - text + return ( + text.length <= 240 && + /(?:can you |could you |please )?(?:create|generate|make|draw)\b.+\b(?:image|picture|drawing|illustration)\b/i.test( + text + ) ); } diff --git a/test/responses.test.js b/test/responses.test.js index e70ffb4..cced89b 100644 --- a/test/responses.test.js +++ b/test/responses.test.js @@ -72,6 +72,7 @@ test('isImageRequest catches several phrasings', () => { assert.ok(isImageRequest('can you create an image of a cat')); assert.ok(isImageRequest('please draw me a picture')); assert.ok(isImageRequest('generate an illustration of a sunset')); + assert.ok(!isImageRequest(`please make ${'draw '.repeat(250)}this eventually become an image`)); assert.ok(!isImageRequest('what is an image')); assert.ok(!isImageRequest('')); });