fix: treat signal-killed agents as success when output was delivered
Two bugs fixed: 1. agent-runner: process close handler only checked `code !== 0`, but signal kills (SIGTERM/SIGKILL from post-close cleanup) set code=null which was misclassified as error even after successful output delivery. Now checks `code === null && signal` and resolves as success when hadStreamingOutput is true. 2. message-agent-executor: wrappedOnOutput persisted newSessionId before checking for poisoned session, allowing a stale session to be re-saved after clearSession. Reordered to check poison first and guard persist with !resetSessionRequested. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -140,9 +140,6 @@ export async function runAgentForGroup(
|
||||
|
||||
const wrappedOnOutput = onOutput
|
||||
? async (output: AgentOutput) => {
|
||||
if (persistSessionIds && output.newSessionId) {
|
||||
deps.persistSession(group.folder, output.newSessionId);
|
||||
}
|
||||
if (
|
||||
persistSessionIds &&
|
||||
isClaudeCodeAgent &&
|
||||
@@ -150,6 +147,13 @@ export async function runAgentForGroup(
|
||||
) {
|
||||
resetSessionRequested = true;
|
||||
}
|
||||
if (
|
||||
persistSessionIds &&
|
||||
output.newSessionId &&
|
||||
!resetSessionRequested
|
||||
) {
|
||||
deps.persistSession(group.folder, output.newSessionId);
|
||||
}
|
||||
const evaluation = evaluateStreamedOutput(output, streamedState, {
|
||||
agentType: isClaudeCodeAgent ? 'claude-code' : 'codex',
|
||||
provider,
|
||||
|
||||
Reference in New Issue
Block a user