From 8119b0bb8fbdd30026cc77cdcbce5e88ce628692 Mon Sep 17 00:00:00 2001 From: Eyejoker Date: Sun, 29 Mar 2026 21:24:49 +0900 Subject: [PATCH] fix: treat execution as success when output was delivered despite null result --- src/message-agent-executor.ts | 5 +++-- src/paired-execution-context.ts | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/message-agent-executor.ts b/src/message-agent-executor.ts index 11283d2..8bccd26 100644 --- a/src/message-agent-executor.ts +++ b/src/message-agent-executor.ts @@ -898,8 +898,9 @@ export async function runAgentForGroup( return 'error'; } - // success-null-result with no visible output — agent returned nothing useful - if (primaryAttempt.sawSuccessNullResultWithoutOutput) { + // success-null-result with no visible output — agent returned nothing useful. + // But if output was already delivered to Discord (sawOutput), treat as success. + if (primaryAttempt.sawSuccessNullResultWithoutOutput && !primaryAttempt.sawOutput) { logger.error( { group: group.name, chatJid, runId }, 'Agent returned success with null result and no visible output', diff --git a/src/paired-execution-context.ts b/src/paired-execution-context.ts index 5e14baf..12e7704 100644 --- a/src/paired-execution-context.ts +++ b/src/paired-execution-context.ts @@ -48,7 +48,8 @@ function classifyReviewerVerdict( // from quoted/referenced status markers in the body text. if (/^\*{0,2}BLOCKED\*{0,2}\b/.test(firstLine)) return 'blocked'; if (/^\*{0,2}NEEDS_CONTEXT\*{0,2}\b/.test(firstLine)) return 'needs_context'; - if (/^\*{0,2}DONE_WITH_CONCERNS\*{0,2}\b/.test(firstLine)) return 'done_with_concerns'; + if (/^\*{0,2}DONE_WITH_CONCERNS\*{0,2}\b/.test(firstLine)) + return 'done_with_concerns'; if (/^\*{0,2}DONE\*{0,2}\b/.test(firstLine)) return 'done'; return 'continue'; }