Skip to content

[Bug]: Thread stays Waiting on green CI — sidebar updates before PullRequestWatchReactor sweep (GitLab) #39602

Closed as duplicate

Description

@tiborrr

Before submitting

  • I searched existing issues and did not find a duplicate that covers this UI mismatch.
  • I included enough detail to reproduce or investigate the problem.

Related: #37477 (same 2-minute PullRequestWatchReactor sweep lag; that report is GitHub-focused). This issue is the user-visible Waiting vs green-sidebar mismatch on GitLab, with measured lags on t3 v0.1.10.

Area

apps/server (also client status: Waiting · Watching pull request)

Summary

When an agent is babysitting a GitLab MR with watch_pull_request, the PR sidebar can show green checks / Merge as soon as CI finishes, while the thread footer stays Waiting · Watching pull request #N for up to ~2 minutes until the next PullRequestWatchReactor sweep. Only then does checksPending clear and the agent get a checks passed wake.

So from the user's point of view the thread looks stuck on finished CI. The watch does eventually wake; it is late relative to the sidebar.

Why (from local 0.1.10 binary + server.trace.ndjson)

  • PullRequestWatchReactor: SWEEP_MINUTES = 2. No PROBE_SECONDS pending-check probe in this build.
  • Sidebar / PR detail updates via PullRequestSyncReactor + pullRequests.detail on a faster path.
  • Thread Waiting is driven by pending background work: a PR watch task is { awaited: true } unless link.watch.checksPending === false. That flag only flips when the watch reactor records a read — same cadence as the agent wake.

Steps to reproduce

  1. On t3 v0.1.10, link/watch a GitLab MR whose pipeline takes several minutes.
  2. Have the agent push, call watch_pull_request, and end the turn.
  3. When the pipeline goes green, open the thread: note sidebar green check vs footer Waiting · Watching….
  4. Compare GitLab pipelines/:id.finished_at with the thread's pr-watch / checks passed notification time.

Observed timelines (UTC, machine on)

MR / pipeline CI finished_at Sidebar-ish sync/detail Agent wake (checks passed) Lag
tax-office MR !46 / pipeline 4155 (6ac85c6) 08:01:26 PullRequestSyncReactor / pullRequests.detail around 08:01:22 08:03:22 115s
same MR / pipeline 4151 (2a6ee60) 07:41:59 — 07:42:58 59s
keycloak MR !3 / pipeline 4156 (ce44dce) 08:03:53 — 08:05:23 90s

Screenshot case (4155) watch reactor sequence:

  • 07:43 — agent rebased/pushed 6ac85c6, left watch armed, ended turn
  • 08:00:00 — PullRequestWatchReactor.sweep (CI still running; this sweep ran long)
  • 08:01:26 — GitLab pipeline success
  • 08:01:22+ — sync/detail already reflecting green (sidebar)
  • 08:03:10 — next watch sweep
  • 08:03:22 — PullRequestWatchReactor.record + wake

Expected behavior

Once CI is terminal on the watched head, either:

  1. the watch notices within seconds (pending-check probe / host events), and/or
  2. the thread leaves Waiting as soon as the UI already knows checks are done (same freshness as the sidebar),

so the footer does not show Waiting · Watching… against a green Merge-ready PR for ~1–2 minutes.

Actual behavior

Sidebar: green. Footer: still Waiting. Agent idle until the next 2-minute watch sweep.

Impact

Looks like a hung babysit. Users interrupt or re-prompt while the watch is merely waiting for the sweep. On GitLab there is no GitHub event-stream shortcut, so every pass/fail pays the sweep lag (#37477).

Environment

  • t3 v0.1.10 (WSL runtime)
  • Host: GitLab (self-hosted), glab auth
  • Threads observed: babysit / full-send style watches that push, wait for green, then merge/tag

Logs

server.trace.ndjson span names around the mismatch: PullRequestSyncReactor.sweep / getMergeRequestDetail / ws.rpc.pullRequests.detail vs later PullRequestWatchReactor.sweep → record → orchestrationV2.dispatch.pullRequestWatchSync.

Workaround

Wait up to ~2 minutes, or manually prompt the thread after CI is green.

Possible direction

Same as #37477 / #37492 / #37494: probe fingerprints while checksPending between sweeps. Optionally drive checksPending / Waiting from the sync path when it already sees a terminal pipeline, so the UI cannot disagree with itself.

Activity

  1. tiborrr commented on Nov 20, 2026

    @tiborrr
    ContributorAuthor

    Screenshot note

    I could not attach the PNG via gh gist (binary rejected). The captured UI showed:

    • Footer: Waiting · Watching pull request #46
    • Sidebar: green check on #46 with Merge enabled
    • Last agent line: waiting for CI on rebased head 6ac85c6 after a prior green run

    Happy to attach manually if maintainers want the image on the issue.

    Also linking the sweep-lag parent: #37477

  2. tiborrr commented on Nov 20, 2026

    @tiborrr
    ContributorAuthor
    image
  3. juliusmarminge commented on Nov 20, 2026

    @juliusmarminge
    Member

    This is the same problem as #37477, so I'm closing it in favour of that one. If it is different, say how and it will be reopened.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions