Skip to content

Scaffolded orchestrator workflow should skip LLM when needs:human gate is open #15

@genesis-dev-bot

Description

@genesis-dev-bot

What went wrong

The scaffolded genesis-orchestrator.yml (scheduled, runs every 6h) invokes the Claude Code Action unconditionally. When a needs:human gate issue is open, the orchestrator has nothing to do — it reads state, confirms the gate, and exits. Each of these idle runs costs ~$0.13.

Observed in: Sayfan-AI/ronny-learns-ai
Duration: Issue #616 sat open for 4+ days (milestone completion waiting for human approval), producing 17 idle runs ($2.21 wasted).

Proposed fix

Add a pre-flight step in the scaffolded genesis-orchestrator.yml before the anthropics/claude-code-action step:

- name: Check for open needs:human gate
  id: gate-check
  env:
    GH_TOKEN: ${{ steps.app-token.outputs.token }}
  run: |
    COUNT=$(gh issue list --label "needs:human" --state open --json number --jq length)
    if [ "$COUNT" -gt 0 ]; then
      echo "skip=true" >> "$GITHUB_OUTPUT"
      echo "Skipping LLM run: $COUNT open needs:human issue(s) require human action."
      gh issue list --label "needs:human" --state open --json number,title --jq '.[] | "  #\(.number) \(.title)"'
    else
      echo "skip=false" >> "$GITHUB_OUTPUT"
    fi

- uses: anthropics/claude-code-action@v1
  if: steps.gate-check.outputs.skip != 'true'
  with: ...

Important: This guard should only be on the scheduled orchestrator workflow template, NOT on the events workflow (genesis-events.yml). A human closing a needs:human issue fires via the events workflow and IS the trigger to advance — that workflow must always run.

Metadata

Metadata

Assignees

No one assigned

    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