Fix multiple PRs opened for single autoloop program - #124
Conversation
…branches
The autoloop agent was creating new PRs with hash-suffixed branches on each
iteration instead of pushing to the existing PR. Root causes addressed:
1. Pre-step now detects existing open PRs for the selected program via the
GitHub API and includes `existing_pr` and `head_branch` in autoloop.json.
The agent no longer needs to discover PRs itself — the information is
provided upfront.
2. Agent instructions updated to check `existing_pr` first and only call
`create-pull-request` when no PR exists.
3. sync-branches.md now filters out stale branches with 16-char hex suffixes
(created by the framework), only syncing canonical autoloop/{name} branches.
4. Lock files recompiled.
Agent-Logs-Url: https://github.com/githubnext/tsessebe/sessions/61bed3ca-384f-49d2-8f81-d557fff66250
Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
Agent-Logs-Url: https://github.com/githubnext/tsessebe/sessions/61bed3ca-384f-49d2-8f81-d557fff66250 Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
|
@copilot Can we store the existing branch and name open PR link in the long-running issue for each program, linked prominently at the top? That way we know exactly where to find it. Also, make it CONVENTIONAL, with the program name as the branch name, so it's always obvious (I thnk we do that already). |
The experiment log issue body now includes a prominent links table at the
top showing Branch, Pull Request, Steering Issue, and State File. This
makes it immediately obvious where to find each program's resources.
Branch naming already follows the convention autoloop/{program-name}.
Agent-Logs-Url: https://github.com/githubnext/tsessebe/sessions/f346c4f9-d6bc-43b6-829f-eda813c79831
Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
Done in d3d7f15. The experiment log issue body format now has a prominent links table at the top showing Branch, PR, Steering Issue, and State File — matching what the steering issue and status comment already had. The branch naming is already conventional: always |
Autoloop creates a new PR with a hash-suffixed branch (e.g.
autoloop/build-tsb-pandas-typescript-migration-480c452af2b58478) on every iteration instead of pushing to the existing PR. 20+ orphaned PRs accumulated for the same program.Pre-step PR detection (
autoloop.md)The scheduling pre-step now queries the GitHub API for an existing open PR on the canonical branch before handing off to the agent:
Outputs
existing_pr(PR number or null) andhead_branch(canonical name) inautoloop.json. Falls back to the state file'sPRfield if the API call fails.Agent instructions (
autoloop.md)existing_pras the primary signal for whether to usepush-to-pull-request-branchvscreate-pull-requestExperiment log issue links (
autoloop.md)The experiment log issue body format now includes a prominent links table at the top showing Branch, Pull Request, Steering Issue, and State File — making each program's resources immediately discoverable from the long-running issue.
Stale branch filtering (
sync-branches.md)The sync workflow now skips branches matching
-[0-9a-f]{16}$(framework-generated hash suffixes), only syncing canonicalautoloop/{name}branches. Prevents wasted merge work on dozens of orphaned branches.Lock files
Recompiled via
gh aw compile.