Skip to content

Upstream tracker stalls silently once its sync branch exists without a pull request #3448

Backlog

Description

@Birfy

Upstream tracker stalls silently once its sync branch exists without a pull request

The daily Track upstream DS Bot workflow (.github/workflows/ds-bot-upstream-track.yml) pushes
upstream/ds-bot-<tag>, then opens the pull request. When opening the pull request fails, the run
is red once and the branch stays behind; every later run then takes the "branch already exists"
path, skips sync, suite, smoke and pull-request creation, and reports success. Nothing retries,
no pull request appears, and nothing on the issue tracker says the pin is behind.

Observed on main 2facf12ebf5a2151e17dcc497a5b3da5a674580f (tree 03576b02), 2026-11-29.

Actual

Pin on main is still v0.3.10 (d104d9ca18d69a35460f14e15dff4d553181433a, ds-bot 0.3.10, DSH
0.2.2-rc.1), while upstream Fei2411/DS-Bot has three newer releases:

tag commit
v0.4.0 7963e66a74f40d23daa288a76cdca72b34e39561
v0.4.1 ca0116af3bde8888e13910df2bb9add3800f390a
v0.4.2 4a31316bb5c45aa7408c7157d09fd5ad26f7ee50

Two sync branches exist in the repository and no pull request has ever been opened from either
(GET /repos/ThinkFlowLab/FlyBot/pulls?head=ThinkFlowLab:upstream/ds-bot-v0.4.2&state=all → [],
same for v0.4.0):

  • upstream/ds-bot-v0.4.0 → 8eb905ad1af508894c1d24cf7e88e0521d10cd2a
  • upstream/ds-bot-v0.4.2 → c422d5bef389c22726400e0d08676a15dc38d233 (its pin reads tag v0.4.2,
    commit 4a31316b…, ds-bot 0.4.2, DSH 0.2.2-rc.5, 12 paths, so the sync itself worked)

Run history of the workflow (/actions/workflows/ds-bot-upstream-track.yml/runs):

run date sync · suite · smoke · pr conclusion
45976212422 11-27 success · success · success · failure failure
46128184106 11-28 success · success · success · failure failure
46244596502 11-29 skipped · skipped · skipped · skipped success

So the pull-request step failed twice, and the third day reported green while doing nothing.

Why

In Find the target release:

if [ "$skip" = false ] && git ls-remote --exit-code --heads origin "$branch" >/dev/null; then echo "Branch $branch already exists"; skip=true; fi

skip=true is the only signal that the work is done, but it is set by the branch existing, not by
a pull request existing. Push and open the pull request runs only when skip == false, so once
the branch is pushed and gh pr create fails, the workflow can never try again.

gh pr create failing twice points at repository configuration (not permitted for GITHUB_TOKEN,
and no DS_BOT_TRACK_TOKEN secret), which the step's own error message names — but the workflow
turning that into a permanent silent stall is a code problem.

Expected

  • A branch that exists without an open pull request must not count as done: the run should retry
    opening the pull request from the existing branch (or fail, loudly, every day).
  • A run that skips must not be indistinguishable from a run that opened a pull request.

Proposed slice (one PR)

.github/workflows/ds-bot-upstream-track.yml only:

  1. Replace the "branch exists" test with "an open pull request exists for this head"
    (gh pr list --head "$branch" --state open --json number), and keep the branch name in the
    output so the skip message names why.
  2. When the branch exists but no open pull request does, still run the pull-request step for that
    branch (reuse the pushed branch, no re-sync), so one failed gh pr create cannot stall the
    tracker.
  3. Keep the run red when no pull request can be opened, and print the branch name in the error.

Acceptance for review:

  • workflow_dispatch with ref: v0.4.2 on this patch: a pull request appears for
    upstream/ds-bot-v0.4.2 and the run is green (or stays red with an error naming the reason if
    the repository still forbids Actions-created pull requests — then the remedy is the
    DS_BOT_TRACK_TOKEN secret or the repository setting, a human decision).
  • With an open pull request already present, a second dispatch skips and says so.
  • git ls-remote --heads of the branch alone no longer stops the job.

Not in this slice: actually upgrading the pin to v0.4.2 (vendor tree plus container, a separate
risk:T3 change that needs its own review), and the missing DS_BOT_TRACK_TOKEN secret.

Related #3399.

Verified cause of the failed pull-request step

Repository configuration, checked on main 2facf12e (2026-11-29):

  • GET /repos/ThinkFlowLab/FlyBot/actions/permissions/workflow → default_workflow_permissions: read,
    can_approve_pull_request_reviews: false. The workflow grants the job contents: write and
    pull-requests: write, so the missing piece is the repository setting that lets GITHUB_TOKEN
    create pull requests.
  • GET /repos/ThinkFlowLab/FlyBot/actions/secrets → total_count 0, so DS_BOT_TRACK_TOKEN is not
    set either.

Both remedies are human decisions (enable the setting, or add the secret); the silent stall is the
code side of this issue.

Activity

  1. added
    agent-ready
    agent-working
    on Nov 29, 2026
  2. Birfy commented on Nov 29, 2026

    @Birfy
    CollaboratorAuthor

    Claimed. Branch: dev/3448-upstream-track-stall, cut from main at 2facf12ebf5a2151e17dcc497a5b3da5a674580f.

    Slice (one PR, one file): .github/workflows/ds-bot-upstream-track.yml.

    Input: the current Find the target release step, where skip=true is set by git ls-remote --heads finding the sync branch, and Push and open the pull request runs only when skip == false.

    Output:

    1. "done" means an open pull request exists for the head branch, not that the branch exists; the skip message names the pull request number.
    2. When the branch exists but no open pull request does, the pull-request step still runs against that branch (reuse it, no re-sync), so one failed gh pr create cannot stall the tracker for good.
    3. A run that cannot open a pull request stays red and names the branch and the reason.

    Acceptance for review:

    • workflow_dispatch with ref: v0.4.2 on the patched workflow: either a pull request appears for upstream/ds-bot-v0.4.2, or the run is red with an error naming the repository setting or the missing secret. A green run with every step skipped is not accepted.
    • With an open pull request already present, a second dispatch skips and says which pull request.
    • git ls-remote --heads alone no longer stops the job.
    • No change to the pin, to runtime/ds-bot-upstream, or to any container file in this slice.

    Dirs touched: .github/workflows/ only.

    Out of scope: bumping the pin to v0.4.2, and the repository setting / DS_BOT_TRACK_TOKEN secret (both are owner decisions recorded in this issue).

    Evidence to hand over with the patch: the patched workflow file at the exact head commit, a workflow_dispatch run id (or a dry-run transcript if dispatch is not available locally), and the step-level conclusion for the pull-request step.

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

    agent-readyagent-working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions