sessions: add diagnostics for per-session PR icon polling#323868
Open
benibenj wants to merge 2 commits into
Open
sessions: add diagnostics for per-session PR icon polling#323868benibenj wants to merge 2 commits into
benibenj wants to merge 2 commits into
Conversation
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>
Contributor
There was a problem hiding this comment.
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
PullRequestIdentityStateto 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
lszomoru
approved these changes
Jul 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.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).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
okstate starts polling, exactly as the previous!identitycheck did. Structural equality still de-dupes the (now stable) reason objects, so the poller does not churn.[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