Skip to content

ci(auto-format): workflow-only exit never records success — LAST_SUCCESS_SHA stalls and every 15-min run re-diffs the same range #4752

Closed

Description

@dezren39

Finding

In .github/workflows/auto-format.yml, the workflow-only early exit introduced by PR #3198 never records success, so the AUTO_FORMAT_LAST_SUCCESS_SHA fast path never engages after a workflow-only head.

PR #3198 (merged 5018339, for #3118) partitioned changed files into format_files / skipped_workflow_files and added this branch:

if ((${#format_files[@]} == 0)); then
  echo "Only workflow files changed; nothing for the auto-format bot to push."
  exit 0
fi

The 2026-11-02 scheduled redesign added record_success (which stores the current HEAD in the repo variable AUTO_FORMAT_LAST_SUCCESS_SHA) to every other terminal success path in the same run block — verified on current main (two independent reads of the file via the contents API, full text + grep):

  • no changed files → record_success then exit (lines 93–94)
  • treefmt made no changes → record_success then exit (lines 122–123)
  • after a successful push → record_success (line 142)
  • workflow-only branch → plain exit 0 (line 115), no record_success

Why it matters

The workflow header states the design intent: "a run whose HEAD still equals it [LAST_SUCCESS_SHA] exits immediately". After any merge whose changed-file range is workflow-only, that never happens: every 15-minute scheduled run re-checks out the repo, installs Nix, re-diffs the same range, and re-logs the same skipped workflow files, until an unrelated non-workflow change happens to land and a later branch records success. The variable is documented as an optimization rather than a correctness input, so nothing breaks — it is pure recurring CI burn (up to 96 scheduled runs/day) plus noisy duplicate "Skipping workflow file(s)" logs that make the skip look unhandled.

Acceptance criteria

Found by the pr-diff-review job reviewing PR #3198 (batch #3190–#3217, developing-today/code). Deduped: #3118 (closed) is the original push-rejection bug this branch fixed; no open or closed issue mentions record_success or the workflow-only stall.

Activity

  1. added
    kind/ciCI/CD pipelines, workflows, and build automation
    task/triageQueue packet kind: verify, reproduce, and route this item
    priority/lowNice to have; do when convenient
    queue/queuedHas a queued task in the Supabase agent queue
    area/ciCI/CD pipelines, workflows, and build automation (area)
    effort/xsTrivial: expected under 30 minutes of work
    on Nov 3, 2026
  2. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

  3. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 3, 2026
  4. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · claimed

  5. 7 remaining items

  6. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

    • Agent: OpenChamber scheduled lane
    • Session / ID: OpenCode ses_e5e6081f402ffeKevOoc1mRECS; lane 9aca43b4-5439-4939-9f71-323f5d32521b
    • Found via: repo-health-code-pilot task 6745
    • Task: Triage complete; confirmed the optimization defect and enqueued implementation task 6748.
    • Expectation: task 6748 will record success before the workflow-only early exit and add coverage for the subsequent unchanged-HEAD fast path without changing fix(ci): auto-format push is rejected when the format diff touches workflow files (PR #2148) #3118 behavior.
    • Links: queue task 6748; findings and verification are in the previous agent note.
  7. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 3, 2026
  8. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · claimed

    • Agent: OpenChamber scheduled lane
    • Session / ID: OpenCode ses_e5e6081f402ffeKevOoc1mRECS; lane 9aca43b4-5439-4939-9f71-323f5d32521b
    • Found via: repo-health-code-pilot task 6748 (own triage follow-up)
    • Task: Record success on the workflow-only auto-format exit and extend coverage for the unchanged-HEAD fast path.
    • Expectation: effort/xs — small workflow change plus a regression assertion; preserve fix(ci): auto-format push is rejected when the format diff touches workflow files (PR #2148) #3118 exclusions.
    • Links: queue task 6748; source findings in the previous agent note.
  9. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · PR opened

  10. added a commit that references this issue on Nov 3, 2026
  11. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/ciCI/CD pipelines, workflows, and build automation (area)effort/xsTrivial: expected under 30 minutes of workkind/ciCI/CD pipelines, workflows, and build automationpriority/lowNice to have; do when convenientsource/pr-diff-reviewFiled by the pr-diff-review jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions