Skip to content

Scheduling pre-step: sys.exit(1) fails workflow noisily when no programs are due #27

Description

@mrjf

Problem

When no programs are due for a scheduled run, the scheduling pre-step exits with sys.exit(1) (line 456 of .github/workflows/autoloop.md):

if not selected and not unconfigured:
    print("\nNo programs due this run. Exiting early.")
    sys.exit(1)  # Non-zero exit skips the agent step

This causes the workflow run to show as failed (red X) in the Actions UI, even though "no programs due" is a normal, expected outcome for scheduled runs. On a 6-hour schedule, most runs will have nothing to do — each one creates a noisy failure notification.

Proposed fix

Exit successfully and gate the agent step on an output flag instead:

  1. Write a sentinel to /tmp/gh-aw/autoloop.json indicating no programs are selected (similar to the existing no_programs case on line 268-269 which already uses sys.exit(0)).
  2. Have the agent step check the sentinel and skip itself when there's nothing to run.

This keeps "no programs due" as a quiet success while still preventing the agent from running unnecessarily.

Origin

Flagged by Copilot code review on github/gh-aw#24345.

File to change

.github/workflows/autoloop.md — scheduling pre-step, currently line ~456.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions