Skip to content

techdebt_file_debt opens its filing pull request with no label, so no gatherer can ever see it and every autonomous filing strands

Id: TD-PPagop-26082426 · Status: resolved · Filed: 2026-08-24 · Resolved: 2026-08-27 · Ref: https://github.com/Poetic-Poems/agent-ops/pull/837

What. techdebt_file_debt (lib/tech-debt-file.sh) ends by calling gh pr create -R "$repo" --base main --head "$branch" --title ... --body-file .... It passes no --label. Every gatherer that looks at pull requests filters on exactly one: gh pr list -R "$slug" --state open --label "$pr_label", where pr_label defaults to autonomous-agent — gather-review-feedback.sh:194,222, gather-abandoned-drafts.sh:162,208, gather-merge-conflicts.sh:195,228, gather-dequeued.sh:201,221, gather-human-visibility-hygiene.sh:203,374. An unlabelled pull request is therefore invisible to review gathering, to the abandoned-draft recovery, to merge-conflict detection, and to the dequeue sweep, all at once.

Why it matters. The filing pull request is the only thing that makes a td-record/<id> branch and its td/<id> reservation reachable — that is stated as the function’s own invariant in the header, and sweep-orphan-branches.sh will not recover either one (td-record/ is not a prefix it sweeps, and a bare reservation lock is one it deliberately leaves alone, issue #545). So a filing pull request that no gatherer can see is not merely slow to land: nothing will ever review it, nothing will notice it going stale, and nothing will notice it conflicting.

Observed directly on 2026-08-23: pull requests #710, #711, #717, #730 and #744 — every filing techdebt_file_debt has ever opened — were all open, all with every check green, all with updatedAt == createdAt, and all unlabelled. The oldest, #710, had sat untouched for 21 hours. In the same window #730 silently developed a hard merge conflict (its ID was taken by #737’s ride-along filing and its reservation released out from under it) and gather-merge-conflicts.sh could not see that either; it had to be found by hand and re-filed as TD-PPagop-26082425. This is the same failure class as TD-PPagop-26082315 — “a pull request no gatherer can find” — but arriving through the Script’s own filing helper rather than through a work order.

Where. lib/tech-debt-file.sh, the gh pr create call at the end of techdebt_file_debt (around line 230). The label to apply is the calling repository’s effective pr_label, which lib/config-schema.sh:472 already resolves per repository and lib/labels.sh already guarantees exists in the target repo.

Suggested fix. Pass --label "$pr_label" on the gh pr create call, taking the effective per-repository pr_label rather than the literal autonomous-agent, so a repository that overrides it is still gathered. Note the two callers — the Approver and the Enabler — reach this function from stages that do not otherwise resolve config, so the label most likely has to be threaded in as an argument alongside REPO, defaulted from the resolved config at the call site. A test should assert the created pull request carries the label, since the failure is silent in both directions: the filing succeeds, returns a URL, and reports success.

Noticed while clearing the five stranded td-record/* filing pull requests by hand on 2026-08-23.