Skip to content

agentHost: Preserve editor defaults on first send#326072

Merged
roblourens merged 2 commits into
mainfrom
roblou/agents/ahp-eval-folder-isolation
Jul 16, 2026
Merged

agentHost: Preserve editor defaults on first send#326072
roblourens merged 2 commits into
mainfrom
roblou/agents/ahp-eval-folder-isolation

Conversation

@roblourens

Copy link
Copy Markdown
Member

Summary

  • wait for an in-flight provisional Agent Host session before taking the direct creation fallback
  • apply the same editor-window session defaults to provisional and direct creation paths
  • preserve explicit request configuration as authoritative
  • make cancellation interrupt the provisional wait

Motivation

A fast first send could race asynchronous provisional creation. When the fallback created the session without editor defaults, Git repositories inherited the provider's Worktree isolation default instead of the editor window's Folder isolation default.

Validation

  • npm run compile
  • npm run precommit
  • client type-check and focused ESLint
  • 33 focused Agent Host tests

(Written by Copilot)

Wait for in-flight provisional sessions before falling back to direct creation, and apply the same editor-window defaults on both paths. Keep explicit request configuration authoritative and make the provisional wait cancellation-aware. (Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 15, 2026 23:15

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.

Pull request overview

Prevents first-send races from bypassing editor session defaults.

Changes:

  • Waits for provisional session creation with cancellation support.
  • Merges editor defaults with authoritative request configuration.
  • Adds focused regression tests.
Show a summary per file
File Description
agentHostUntitledProvisionalSessionService.ts Exposes editor initial configuration.
agentHostSessionHandler.ts Waits for provisional creation and merges defaults.
agentHostUntitledProvisionalSessionService.test.ts Verifies provisional isolation defaults.
agentHostChatContribution.test.ts Tests defaults, races, and cancellation.

Review details

  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Medium

Recheck cancellation after eager session hydration so a cancelled send cannot fall through to direct session creation. Add a regression test for cancellation while hydration is pending. (Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@roblourens roblourens marked this pull request as ready for review July 16, 2026 18:15
@roblourens roblourens enabled auto-merge (squash) July 16, 2026 18:15
@roblourens roblourens merged commit 1b31f71 into main Jul 16, 2026
29 checks passed
@roblourens roblourens deleted the roblou/agents/ahp-eval-folder-isolation branch July 16, 2026 18:29
@vs-code-engineering vs-code-engineering Bot added this to the 1.130.0 milestone Jul 16, 2026
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