-
Notifications
You must be signed in to change notification settings - Fork 0
Fix exit-code verification across completion paths #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -4669,7 +4669,9 @@ export class WorkflowRunner { | |||||
| { exitCode: executorResult.exitCode } | ||||||
| ); | ||||||
| const verificationResult = step.verification | ||||||
| ? this.runVerification(step.verification, output, step.name) | ||||||
| ? this.runVerification(step.verification, output, step.name, undefined, { | ||||||
| exitCode: executorResult.exitCode, | ||||||
| }) | ||||||
| : undefined; | ||||||
| return { | ||||||
| output, | ||||||
|
|
@@ -4780,7 +4782,9 @@ export class WorkflowRunner { | |||||
| ); | ||||||
|
|
||||||
| const verificationResult = step.verification | ||||||
| ? this.runVerification(step.verification, output, step.name) | ||||||
| ? this.runVerification(step.verification, output, step.name, undefined, { | ||||||
| exitCode: lastExitCode, | ||||||
| }) | ||||||
| : undefined; | ||||||
| lastCommandOutput = [commandStdout || output, commandStderr].filter(Boolean).join('\n'); | ||||||
|
|
||||||
|
|
@@ -5785,7 +5789,8 @@ export class WorkflowRunner { | |||||
| step.verification, | ||||||
| specialistOutput, | ||||||
| step.name, | ||||||
| promptTaskText | ||||||
| promptTaskText, | ||||||
| { exitCode: this.getStepCompletionEvidence(step.name)?.process.exitCode } | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: API-backed agent steps with Prompt for AI agents
Suggested change
|
||||||
| ); | ||||||
| completionReason = verificationResult.completionReason; | ||||||
| } | ||||||
|
|
@@ -6652,6 +6657,7 @@ export class WorkflowRunner { | |||||
| ? this.runVerification(step.verification, specialistOutput, step.name, verificationTaskText, { | ||||||
| allowFailure: true, | ||||||
| completionMarkerFound: hasMarker, | ||||||
| exitCode: this.getStepCompletionEvidence(step.name)?.process.exitCode, | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: For supervised steps, Prompt for AI agents |
||||||
| }) | ||||||
| : { passed: false }; | ||||||
|
|
||||||
|
|
@@ -6959,7 +6965,7 @@ export class WorkflowRunner { | |||||
| specialistOutput, | ||||||
| step.name, | ||||||
| verificationTaskText, | ||||||
| { allowFailure: true } | ||||||
| { allowFailure: true, exitCode: evidence?.process.exitCode } | ||||||
| ); | ||||||
| if (!verificationResult.passed) return null; | ||||||
| } | ||||||
|
|
@@ -7983,7 +7989,7 @@ export class WorkflowRunner { | |||||
| ptyOutput, | ||||||
| step.name, | ||||||
| preparedTask.promptTaskText, | ||||||
| { allowFailure: true } | ||||||
| { allowFailure: true, exitCode: agent?.exitCode } | ||||||
| ); | ||||||
| if (verificationResult.passed) { | ||||||
| this.log(`[${step.name}] Agent timed out but verification passed — treating as complete`); | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3: mockSpawnExitCodes only feeds the pty handle (makeMockHandle), but the node:child_process
spawnmock still emitsclosewith a hardcoded 0 and never consumes from mockSpawnExitCodes. Any test in this file that drives exit_code verification through the child-spawn path would silently report 0 regardless of the configured code, and because WorkflowAgentHandle.exitCode readsinner.exitCode, the affected path depends on which mock the spawn goes through. Either wire the spawn mock to mockSpawnExitCodes or leave a comment stating that exit codes are only controllable for the pty path so future tests don't rely on a mechanism that doesn't apply.Prompt for AI agents