Repository navigation
chat: preserve errors from coalesced session refreshes - #345717
Merged
Osvaldo Ortega (osortega) merged 1 commit intoNov 3, 2026
Merged
Conversation
A queued resolution can consume a later manual refresh before that caller's debounce expires. Keep refresh intent and errors in the same batch so callers observe the right failure even when a later request replaces their delayed task. Do not execute an already consumed batch again. Add regressions for overlapping queues, a later successful refresh, and exactly-once error delivery to coalesced callers. Follow-up to #345710 and the review on #345711; related #345234. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the coalesced chat session refresh error-propagation change.
No open issues 🎉
What changed in this PR
This follow-up to #345710 fixes error propagation in coalesced chat session refreshes, so callers retain failures from their batch even when another queued task executes it or a later refresh succeeds.
Changes:
- Keep refresh intent, lazy-item resolution, and errors together in a provider batch, preventing duplicate execution.
- Add three regression cases covering overlapping refreshes and error delivery to each coalesced caller.
| File | Description |
|---|---|
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentSessionViewModel.test.ts |
Adds overlap and per-caller error-propagation regressions. |
src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.ts |
Preserves batch errors across delayed and queued refresh tasks. |
Review effort: Balanced
Osvaldo Ortega (osortega)
marked this pull request as ready for review
November 3, 2026 03:45
Osvaldo Ortega (osortega)
enabled auto-merge (squash)
November 3, 2026 03:45
Bhavya U (bhavyaus)
approved these changes
Nov 3, 2026
Osvaldo Ortega (osortega)
deleted the
osortega/agents/session-refresh-errors
branch
November 3, 2026 04:12
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.
Follow-up to #345710, addressing the error-propagation review comment on #345711. Related to #345234.
Problem
An already-queued resolution can consume a later manual caller's refresh intent before that caller's debounce expires. If that refresh fails, the manual caller can await a different task and incorrectly complete successfully without invoking its error handler. A subsequent successful refresh can also mask the earlier failure. This affects callers such as plugin-link session resolution.
Change
Keep refresh intent, lazy-item resolution, and collected errors in one pending provider batch. Each caller retains that batch and returns its errors, even if an earlier queued task executes it or a later request replaces the caller's delayed task. A batch already executed by the throttler is not executed again.
The change is limited to the sessions model and its regression tests. It preserves manual-refresh precedence, request coalescing, lazy item resolution, and the existing cloud freshness behavior. No public API, configuration, telemetry, or feed behavior changes.
Both the original PR and its release cherry-pick have merged; this draft targets
mainand will need a separate release backport.Validation
kerberosAuthis absent fromCopilotClientOptionsatsrc/vs/platform/agentHost/node/copilot/copilotAgent.ts(4426,5)(TS2353) andsrc/vs/platform/agentHost/test/node/copilotAgent.test.ts(14139,61)(TS2339). No new diagnostics.mainat498770fb016918e2f34e586fc5b26a7342f450a1. Full integration/smoke suites and live UI flows were not run.Exact validation commands and results
Refresh existing client output for changed source/dependency files — passed, 48 files before the fix:
node --input-type=module -e "import { execFileSync } from 'node:child_process'; import { applyIncrementalClientChanges } from './build/next/transpile.ts'; const files = execFileSync('git', ['diff', '--name-only', 'ba69f50579d306e24b01564a7aa4cd6a086145cd', '--', 'src'], { encoding: 'utf8' }).trim().split('\n').filter(Boolean); await applyIncrementalClientChanges(process.cwd(), 'out', files); console.log('Refreshed client output for ' + files.length + ' files.');"Compile the final model correction — passed:
node --input-type=module -e "import { applyIncrementalClientChanges } from './build/next/transpile.ts'; await applyIncrementalClientChanges(process.cwd(), 'out', ['src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.ts']);"Focused regression suites — 656 passed, 13 pre-existing skipped:
Changed-file ESLint — passed:
Client type-check — failed with only the two unchanged SDK baseline errors documented above:
Patch whitespace validation — passed before committing: