Closed
Labels
kind/bugSomething isn't working (prefixed form of the classic bug label)Something isn't working (prefixed form of the classic bug label)priority/highImportant and time-sensitiveImportant and time-sensitivesource/pr-diff-reviewFiled by the pr-diff-review jobFiled by the pr-diff-review jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this itemQueue packet kind: verify, reproduce, and route this item
Description
Finding
bin/provider-catalog-sync.mjs (added in PR #1333, the PR-based successor to bin/sync-models.mjs for issue #1297) documents its --open-pr mode as: commit, push, and open a PR via gh — the tool "only ever adds, only through a reviewable PR". The implementation does not create a branch and does not check which branch is checked out:
const git = (...a) => execFileSync('git', a, { cwd: repoDir, stdio: 'inherit' });
git('add', '.opencode/opencode.jsonc');
git('commit', '-m', `chore(opencode): catalog sync ${date} — add validated provider models (#1297)`);
git('push');
execFileSync('gh', ['pr', 'create', '--title', `chore(opencode): catalog sync ${date} (#1297)`, '--body-file', bodyFile], { cwd: repoDir, stdio: 'inherit' });(current main, verified 2026-10-28 at main 32ab6b7600: the --open-pr block is unchanged from PR #1333, commit ae35af44c4.)
Why it matters
- Run from a checkout sitting on
main— the natural state of the laptop checkout this tool is written to run on ("run this on the laptop") —git pushpushes the catalog commit directly to origin/main, bypassing the reviewable-PR guarantee that is the tool's stated reason to exist.gh pr createthen fails (no branch / nothing to compare), but only after the unreviewed change is already on main. - Run from a brand-new local branch with no upstream, bare
git pushfails ("no upstream branch"), leaving a dangling local commit and no PR — the mode only actually works on an already-tracking non-main branch, which nothing in the tool sets up or documents.
Either way the --open-pr path cannot deliver its contract as written.
Evidence
- PR: feat(opencode): provider catalog sync — enumerate, classify, catalog-only PRs (#1297) #1333 "feat(opencode): provider catalog sync — enumerate, classify, catalog-only PRs (Automatic provider-catalog updates: scheduled enumeration, diff, and catalog PRs #1297)", commit
ae35af44c4, filebin/provider-catalog-sync.mjs(themain()--open-prblock; header comment lines stating the PR-only policy). - Verified still present on current main (
32ab6b7600, 2026-10-28) via the GitHub contents API:git('push')with no branch creation, no current-branch check, and no--set-upstreamanywhere in the file. - Deduped: no open or closed issue mentions this; Automatic provider-catalog updates: scheduled enumeration, diff, and catalog PRs #1297 (the parent epic) is closed and does not cover it.
Acceptance criteria
--open-prcreates a dedicated branch (e.g.chore/catalog-sync-<date>) before committing, or refuses to run when the current branch is the default branch — it must be impossible for the mode to push tomain.- The push sets the upstream for the new branch so
gh pr createsucceeds on a first run. - A test or dry-run path pins the branch behaviour (the existing
bin/provider-catalog-sync.test.mjssuite is the natural home). - Header/usage text updated if the invocation contract changes.
Found by the pr-diff-review job reviewing PR #1333's diff.
Metadata
Metadata
Assignees
Labels
kind/bugSomething isn't working (prefixed form of the classic bug label)Something isn't working (prefixed form of the classic bug label)priority/highImportant and time-sensitiveImportant and time-sensitivesource/pr-diff-reviewFiled by the pr-diff-review jobFiled by the pr-diff-review jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this itemQueue packet kind: verify, reproduce, and route this item
Activity
developing-today commentedon Oct 28, 2026
CODE-709
dezren39 commentedon Oct 28, 2026
🤖 Agent note · filed
dezren39 commentedon Oct 28, 2026
🤖 Agent note · picked up
--open-prpush/branch behaviour of bin/provider-catalog-sync.mjs against current main, pin the branch contract, enqueue the fix follow-up. No implementation in this triage task.dezren39 commentedon Oct 28, 2026
🤖 Agent note · done (triage)
Triage verdict — CONFIRMED on current main; branch contract pinned
Verified fresh against origin/main
5ac81cae:bin/provider-catalog-sync.mjs--open-prblock (lines ~664-682) doesgit add→git commit→ baregit('push')(line 675) →gh pr create. A full-file search finds no branch creation, no current-branch check, and no--set-upstreamanywhere. The header (lines 26-28) even documents "push the current branch", while the tool's stated contract (lines 34-37) is that it "only ever ADDS, through a reviewable PR" — the two contradict, and the implementation follows the wrong one. Failure modes as filed: frommainthe catalog commit lands directly on origin/main beforegh pr createfails; from a new unpushed branch the bare push fails for lack of upstream. The existingbin/provider-catalog-sync.test.mjscontains no--open-pr/ push / branch coverage at all. No competing PR or duplicate issue (searched this shift; parent #1297 is closed and does not cover this).Branch contract — PINNED (dedicated branch, not refusal-only):
--open-prmode, before committing, create and switch to a dedicated branch namedchore/catalog-sync-<date>(same UTC date string the commit message already uses). If that branch already exists (same-day rerun), check it out and continue — the push then updates the already-open PR for that date.--open-prmust be unable to commit on, or push to, the default branch even if branch creation is bypassed or renamed later.git push --set-upstream origin chore/catalog-sync-<date>, and pass--head chore/catalog-sync-<date>togh pr createso the PR target never depends on ambient checkout state.bin/provider-catalog-sync.test.mjs: cover the--open-prgit sequence — branch created/checked out before commit, push carries--set-upstreamand the dedicated branch,gh pr createcarries--head, and the default-branch abort fires. (The suite's existing seams decide how — stubbed exec or an extracted command-plan — but the assertions above are the contract.)--open-prcommits on the dedicatedchore/catalog-sync-<date>branch, pushes it with its upstream set, and opens the PR from it. The phrase "push the current branch" goes away.Follow-up: small_fix packet enqueued with the issue's acceptance criteria mapped to the pinned contract above. No implementation in this triage task.
dezren39 commentedon Oct 28, 2026
Follow-up from triage task 1973: the fix is enqueued as queue task 1982 (small_fix, packet
queue-packets/repo-health-v1-fix-developing-today-code-issue-1754.json) with the pinned branch contract from the verdict above. — queue worker Lane D12 remaining items
dezren39 commentedon Oct 28, 2026
🤖 Agent note · parked
chore/catalog-sync-<date>branch contract + 4 new contract tests; laptopnode --test16/16 pass). All PR checks stayed queued through a 5-min poll amid a fleet-wide CI stall.queue/1982-1754-catalog-sync-branch· laptop worktree~/git/fleet/1982fix(catalog-sync): --open-pr commits on dedicated chore/catalog-sync-…
dezren39 commentedon Oct 28, 2026
🤖 Agent note · done