Skip to content

Commit 2c3b7b9

Browse files
Copilotmrjf
andauthored
fix: exit cleanly when no programs are due in scheduling pre-step
Change process.exit(1) to process.exit(0) when no programs are due for a scheduled run. The non-zero exit was causing the workflow to show as failed (red X) in the Actions UI even though "no programs due" is an expected outcome. Also add a `not_due` flag to the JSON sentinel written to /tmp/gh-aw/autoloop.json so the agent step can explicitly detect this case, and document it in the agent instructions. Agent-Logs-Url: https://github.com/githubnext/autoloop/sessions/4d303a41-1658-4db8-bd17-24f7ed43d323 Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
1 parent a2cf5e4 commit 2c3b7b9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

workflows/autoloop.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,7 @@ steps:
541541
issueProgramsMap[name] = info.issue_number;
542542
}
543543
544+
const notDue = !selected && unconfigured.length === 0;
544545
const result = {
545546
selected: selected,
546547
selected_file: selectedFile,
@@ -551,6 +552,7 @@ steps:
551552
skipped: skipped,
552553
unconfigured: unconfigured,
553554
no_programs: false,
555+
not_due: notDue,
554556
};
555557
556558
fs.mkdirSync('/tmp/gh-aw', { recursive: true });
@@ -564,7 +566,7 @@ steps:
564566
565567
if (!selected && unconfigured.length === 0) {
566568
console.log('\nNo programs due this run. Exiting early.');
567-
process.exit(1); // Non-zero exit skips the agent step
569+
process.exit(0);
568570
}
569571
}
570572
@@ -653,6 +655,7 @@ The pre-step has already determined which program to run. Read `/tmp/gh-aw/autol
653655
- **`unconfigured`**: Programs that still have the sentinel or placeholder content.
654656
- **`skipped`**: Programs not due yet based on their per-program schedule.
655657
- **`no_programs`**: If `true`, no program files exist at all.
658+
- **`not_due`**: If `true`, programs exist but none are due for this run.
656659

657660
If `selected` is not null:
658661
1. Read the program file from the `selected_file` path.

0 commit comments

Comments
 (0)