Skip to content

Fix PR webview stuck loading when switching between sessions in agents window - #8943

Merged
Alex Ross (alexr00) merged 1 commit into
mainfrom
alexr00/determined-alligator
Sep 9, 2026
Merged

Fix PR webview stuck loading when switching between sessions in agents window#8943
Alex Ross (alexr00) merged 1 commit into
mainfrom
alexr00/determined-alligator

Conversation

@alexr00

Copy link
Copy Markdown
Member

No description provided.

Copilot AI lite review requested due to automatic review settings September 9, 2026 11:01
@alexr00
Alex Ross (alexr00) enabled auto-merge (squash) September 9, 2026 11:01
@alexr00 Alex Ross (alexr00) self-assigned this Sep 9, 2026
@alexr00
Alex Ross (alexr00) merged commit c90f9ba into main Sep 9, 2026
7 checks passed
@alexr00
Alex Ross (alexr00) deleted the alexr00/determined-alligator branch September 9, 2026 11:07

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.

Copilot review overview

🔵 Needs a closer look

The new resolver can incorrectly choose the remote-only manager while a matching workspace repo is still initializing, which can break local-repo actions for restored/opened overviews.

Review tier: Lite
Findings: None

What changed in this PR

This PR addresses PR/issue overview webviews getting stuck in a loading state when switching sessions (e.g., in the agents window) by improving webview restoration and by resolving PR/issue data through a repository-manager resolver that can fall back to a remote-only manager.

Changes:

  • Prefer serializer-provided webview panels during restore by disposing stale cached panels for the same PR/issue identity.
  • Rework OverviewRestorer to resolve PRs/issues via FolderRepositoryManagerResolver (remote-only fallback) instead of depending on existing workspace GitHub repositories.
  • Thread the new resolver through extension initialization and command registration; add/extend tests for restoration and remote-only resolution.
File Description
src/​test/​uriHandler.test.ts Adds coverage ensuring remote-only manager selection when no workspace manager matches.
src/​test/​github/​pullRequestOverview.test.ts Adds coverage for using a serializer-provided WebviewPanel and replacing stale cached panels.
src/​test/​github/​overviewRestorer.test.ts New test validating PR restoration uses a resolver-provided remote-only manager.
src/​github/​pullRequestOverview.ts Disposes cached panel when a different serializer-provided panel is supplied for the same identity.
src/​github/​overviewRestorer.ts Resolves PRs/issues via FolderRepositoryManagerResolver and removes dependency on preloaded workspace GitHub repos.
src/​github/​issueOverview.ts Mirrors the PR panel behavior for issues when restoring panels.
src/​github/​folderRepositoryManagerResolver.ts Changes default manager selection behavior to create/cache a remote-only manager when no match is found.
src/​extension.ts Creates the resolver once and wires it into command registration and overview restoration.
src/​commands.ts Switches certain PR/issue resolution paths to use the resolver instead of folderManagers[0] fallback.
Suppressed comments (1)

src/github/folderRepositoryManagerResolver.ts:35

  • getManagerForRepository now falls back to the remote-only manager whenever RepositoriesManager.getManagerForRepository returns undefined. During startup/session switches, a workspace FolderRepositoryManager can exist but not yet have populated gitHubRepositories, so this can incorrectly choose the remote-only manager even when a local repo for the target owner/repo is open (which can break local actions like checkout). Consider first matching an existing workspace manager by inspecting its git remotes for the requested owner/repo before falling back to the remote-only manager.
	getManagerForRepository(owner: string, repo: string): FolderRepositoryManager {
		const existingManager = this._repositoriesManager.getManagerForRepository(owner, repo);
		if (existingManager) {
			return existingManager;
		}
		if (this._remoteFolderRepositoryManager) {
			return this._remoteFolderRepositoryManager;
		}

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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