Conversation
…+ deterministic tie-break Agent-Logs-Url: https://github.com/githubnext/tsessebe/sessions/a98d4d22-8daa-4733-ab25-6cd7025a0ddc Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
… fallback Agent-Logs-Url: https://github.com/githubnext/tsessebe/sessions/a98d4d22-8daa-4733-ab25-6cd7025a0ddc Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix autoloop pre-step to read state files correctly
Fix autoloop scheduler starvation: clone repo-memory before pre-step, deterministic tiebreak
Apr 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The autoloop pre-step reads program state from
/tmp/gh-aw/repo-memory/autoloop/, but gh-aw's built-in repo-memory clone runs after the pre-step (and into a different directory). Every program looks like a "first run", and the implicit insertion-order tiebreaker permanently starvedbuild-tsb-pandas-typescript-migrationbehindperf-comparisonfor 8+ days.Changes to
.github/workflows/autoloop.mdClone
memory/autoloopbefore the scheduler runs. New first step insteps:clones the branch into/tmp/gh-aw/repo-memory/autoloop/so the existing Python pre-step actually finds state files. Idempotent (skips if.gitalready present); falls back to an empty dir when the branch doesn't exist (genuine first run).Auth via
http.extraHeaderinstead of token-in-URL to keep the token out of process listings and any logged remote URLs.Deterministic tiebreaker for the due-list sort. Replaces
due.sort(key=lambda p: p["last_run"] or ""), which fell back to insertion order whenlast_runwas absent. New key:schedulewins, then alphabetical by name (programs without a parseable schedule fall back to+inf);last_run, then name.Each due entry now carries
schedule_secondsto support this.Effect
After merge, the pre-step should log
build-tsb-pandas-typescript-migration: last_run=2026-04-12T11:15:07Z, iteration_count=230, that program wins the next selection on most-overdue, and ordinarylast_runordering takes over. The tiebreaker change is defense-in-depth: even if state goes missing again,every 30mbeatsevery 6hinstead of insertion order deciding.