[Bug]: Azure DevOps pull request Code tab never loads when the pull request changes many files#27329
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- Add a project whose remote is an Azure DevOps repository (signed in through
az loginwith theazure-devopsextension). - Open an Azure DevOps pull request that changes a few dozen files or more.
- Open the Code tab.
Expected behavior
The first files' diffs appear within a few seconds, and later files load as you scroll.
Actual behavior
The tab shows "Loading pull request diff..." and never renders. Smaller pull requests load, but slowly (7–19s in my traces).
Impact
Major degradation or frequent failure
Version or commit
Desktop app 0.1.5 (Beta)
Environment
Windows 11 Pro, desktop app with the bundled local server, Azure CLI 2.91.0 with azure-devops extension 1.0.10
Logs or stack traces
From server.trace.ndjson, one Code tab load:
environment.pullRequests.diff(POST /api/pull-requests/diff) endsInterruptedat 60,005 ms, which matches the client's diff timeout (DEFAULT_PULL_REQUEST_DIFF_TIMEOUT_MS = 60_000inpackages/client-runtime/src/state/pullRequestDiffHttp.ts).- Under it,
AzureDevOpsPullRequestProvider.diffScopetook 25.6s,listIterationChanges3.7s, and only onereadItemContentfinished (5.5s). Seven more were interrupted after about 30s each. - Starting
azalone takes about 2.5s on this machine, and the same trace shows the background pull request list runningaz331 times at the same time (6s average).
Diagnosis
AzureDevOpsPullRequestProvider.getDiff builds the first diff page by reading both sides of every changed file, using one az devops invoke process per side. It can read up to MAX_DIFF_SLICE_FILES (300) files before it returns anything. With az starting in seconds per call, a pull request with many files cannot finish a page within the client's 60s limit. The client then cancels the request and the tab never gets its first page. Paging already works through the diff cursor; a page just never stops early enough to use it.
Investigated with Claude Opus 5.5 in T3 Code (Claude Code harness).