Skip to content

sessions: add diagnostics for per-session PR icon polling#323868

Open
benibenj wants to merge 2 commits into
mainfrom
agents/for-the-agent-host-sessions-it-doesn-t
Open

sessions: add diagnostics for per-session PR icon polling#323868
benibenj wants to merge 2 commits into
mainfrom
agents/for-the-agent-host-sessions-it-doesn-t

Conversation

@benibenj

@benibenj benibenj commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

What

Adds targeted diagnostics to GitHubPullRequestPollingContribution (src/vs/sessions/contrib/github/browser/github.contribution.ts) to pinpoint why non-active agent-host session PR status icons don't refresh until the session is activated.

  • Introduces a discriminated PullRequestIdentityState (ok / archived / no-workspace / no-git-repository / no-pull-request) for the per-session identity derivation, and logs the precise stage at which a session's PR model is not kept warm (previously a single generic "no PR identity yet" trace collapsed all four bail-out stages together).
  • Logs the total tracked poller count on each onDidChangeSessions, so we can immediately tell whether the poller even sees the sessions in the list.

Why

Reported symptom: in the agent-host sessions list, a session's PR icon does not update while another session is active — it only refreshes when you click the session to make it active. Renderer logs show the shared PR/CI/review-thread models being created and immediately disposed for non-active sessions (refcount 0->1->0), and the affected PR's review threads only start polling at the moment of activation — i.e. the per-session poller is not keeping non-active sessions warm.

The reactive wiring looks correct on paper, so rather than guess at a fix, this change makes the next repro self-diagnosing: the reason: on the bail-out trace and the tracked-poller count will show exactly which stage fails (never tracked vs. tracked but no workspace/gitRepository/PR).

Notes for reviewers

  • No behavior change. Only the ok state starts polling, exactly as the previous !identity check did. Structural equality still de-dupes the (now stable) reason objects, so the poller does not churn.
  • All new strings are trace-level logs under the existing [PR-ICON-TRACE] prefix — filter renderer logs on [PR-ICON-TRACE] [PollingContribution] to follow it.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Non-active agent-host session PR icons don't refresh until the session is activated. The per-session poller in GitHubPullRequestPollingContribution keeps a shared PR model warm only once its identity resolves, but the previous trace collapsed all four bail-out stages into one generic message and gave no visibility into how many sessions were actually tracked.

Disambiguate the identity derivation into a discriminated PullRequestIdentityState (ok / archived / no-workspace / no-git-repository / no-pull-request) and log the precise stage where a session's PR model is not kept warm, plus the total tracked poller count on each sessions change. Behavior is unchanged; only the 'ok' state starts polling as before.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 1, 2026 12:11
@benibenj benibenj enabled auto-merge (squash) July 1, 2026 12:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds trace-level diagnostics to the Agents window GitHub PR icon polling contribution so that failures to keep non-active sessions “warm” can be attributed to a specific identity-resolution stage (and to confirm whether sessions are being tracked at all).

Changes:

  • Introduces a discriminated PullRequestIdentityState to represent either a resolved PR identity or the specific bail-out reason.
  • Refines per-session polling trace logs to include the precise identity-resolution reason when polling is not active.
  • Logs aggregate tracker counts on session list changes to confirm whether pollers are being created/maintained.
Show a summary per file
File Description
src/vs/sessions/contrib/github/browser/github.contribution.ts Adds a discriminated PR-identity state and more granular trace logging for per-session PR icon polling and tracker visibility.

Review details

  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Low

Comment thread src/vs/sessions/contrib/github/browser/github.contribution.ts
@benibenj benibenj closed this Jul 1, 2026
auto-merge was automatically disabled July 1, 2026 14:19

Pull request was closed

@benibenj benibenj reopened this Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants