fix: treat execution as success when output was delivered despite null result

This commit is contained in:
Eyejoker
2026-03-29 21:24:49 +09:00
parent f28b8861bf
commit 8119b0bb8f
2 changed files with 5 additions and 3 deletions

View File

@@ -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',

View File

@@ -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';
}