Skip to content

fix and enable agents window smoke tests#317764

Open
sandy081 wants to merge 4 commits into
mainfrom
sandy081/handsome-tern
Open

fix and enable agents window smoke tests#317764
sandy081 wants to merge 4 commits into
mainfrom
sandy081/handsome-tern

Conversation

@sandy081
Copy link
Copy Markdown
Member

No description provided.

sandy081 and others added 4 commits May 21, 2026 08:45
Async commit-wait flows (_sendFirstChat, _sendFirstChatViaController,
_sendSubsequentChat) unconditionally cleared _currentNewSession on
completion. When a newer session was created while the previous one was
still awaiting commit, the clear stomped the newer session's pointer —
causing 'Session not found' errors on the next send.

Extract _clearCurrentNewSessionIfMatch() that only clears when the
value still points at the session that initiated the async flow.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 21, 2026 11:50
@sandy081 sandy081 enabled auto-merge (squash) May 21, 2026 11:51
@sandy081 sandy081 self-assigned this May 21, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to re-enable and stabilize the Agents Window smoke tests by improving the mock LLM server integration and addressing a race in Copilot session creation/commit flows in the Agents Window provider.

Changes:

  • Enable the previously skipped Claude and Local Agents Window smoke tests and rename the test cases for clarity.
  • Route mock LLM server request logging through the smoke test logger to improve diagnosability.
  • Add a guarded clearing helper for _currentNewSession and apply it to several async commit/cancellation paths to prevent races that dispose a newer session.
Show a summary per file
File Description
test/smoke/src/areas/agentsWindow/agentsWindow.test.ts Enables Claude/Local smoke coverage and wires mock server logging into the smoke logger.
src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsProvider.ts Prevents _currentNewSession from being cleared/disposed by stale async completions (partial coverage; see PR comment).
scripts/chat-simulation/common/mock-llm-server.js Adds optional logger injection and uses it for request/debug output instead of direct console calls.

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 1

Comment on lines +1752 to +1759
private _clearCurrentNewSessionIfMatch(session: NewSession, leak?: boolean): void {
if (this._currentNewSession.value === session) {
if (leak) {
this._currentNewSession.clearAndLeak();
} else {
this._currentNewSession.clear();
}
}
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.

2 participants