Skip to content

[pull] main from microsoft:main#1389

Merged
pull[bot] merged 33 commits into
KingDEV95:mainfrom
microsoft:main
May 6, 2026
Merged

[pull] main from microsoft:main#1389
pull[bot] merged 33 commits into
KingDEV95:mainfrom
microsoft:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented May 6, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

vritant24 and others added 30 commits May 4, 2026 16:11
…w with drain-queue architecture

Replace the old single-slot coalescing model with a two-slot queue
(regular pass + final review) and a central _drainQueue() scheduler.

Key changes:
- requestRegularPass(): enqueues/coalesces regular passes, always
  updates _lastExecutionContext
- requestFinalReview(turnId): enqueues a final-review pass that drains
  after all regular work, deduplicated by turn ID
- _drainQueue(): central scheduler called after every state transition;
  picks regular work first, then final review
- advanceCursor parameter on _runPass(): regular passes advance the
  delta tracker cursor, final review does not (fixes hidden bug where
  the old code accidentally called markProcessed despite the comment
  saying it should not)
- Turn-scoped _finalReviewAttemptedTurnId replaces the fragile boolean
  _finalReviewQueued that was reset by executePass

The old executeFinalReview() called start() which checked
_state === InProgress as a coalescing gate. Since a regular pass always
finishes before the finally block runs executeFinalReview, the processor
was always Idle and start() would fall through to _runPass()—but only
if the preconditions were met. The new architecture makes final review
a pending queue item that _drainQueue() will run regardless of whether
the processor is Idle, InProgress, or Failed at the time of the request.
- _maybeStartBackgroundTodoPass() calls requestRegularPass() instead of
  executePass(), including for the processorInProgress coalescing case
- handleRequest() finally block calls requestFinalReview(turnId) instead
  of executeFinalReview(), passing the turn ID for deduplication
- Update JSDoc @link reference in BackgroundTodoPromptProps
- Add makeExecutionContext() helper for requestRegularPass/requestFinalReview tests
- Add advanceCursor=false cursor test (verifies final review does not
  advance the delta tracker)
- Add requestFinalReview tests: no-op guards, runs-when-idle,
  turn-ID dedup, drains-after-regular-pass
- Update cancel test to verify it clears final review queue
- Rename executeFinalReview references to requestFinalReview
…uccess/cancelled/error

Today, response.success emits parentRequestId from baseTelemetry.parentHeaderRequestId,
which is the X-GitHub-Request-Id of the previous fetch (a per-fetch / call-level id),
not the parent turn. This doesn't match panel.request.parentRequestId, which uses
the VS Code chat API ChatRequest.parentRequestId (a per-turn, client-side id).

Switch response.success.parentRequestId to baseTelemetry.parentRequestId (sourced
from request.parentRequestId via defaultIntentRequestHandler), so it aligns with
panel.request.

Also emit parentRequestId and conversationId on response.cancelled and
response.error, sourced from the same telemetry properties, so cancelled/errored
requests can be correlated to a parent turn and conversation the same way
successful requests can.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The execution and search subagent tool-calling loops only populated
parentHeaderRequestId on their telemetry properties — not parentRequestId.
These loops are spawned directly from a parent turn's tool call (not via
the VS Code chat-agent mechanism), so VS Code core never sets
ChatRequest.parentRequestId on them. As a result, subagent
response.success/cancelled/error events would not carry the parent's
chat request id, breaking correlation back to the parent.

Set parentRequestId from this.options.request.id (the parent
ChatRequest's id) so subagent telemetry consistently carries the parent
correlation id alongside parentHeaderRequestId.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Make sure that custom diff editors show custom names such as the `(Indexed)` title that get provides

Also makes sure custom diff editors are restored on reload by creating serializers for them
)

* Introduce proposed agentsWindow configuration extension point

Add a new `agentsWindow` property to the configuration contribution point
that allows extensions to declare per-setting default value overrides and
read-only behavior for the Agents window.

Shape: `agentsWindow: { default?: unknown; readOnly?: boolean }`

- Gated behind `agentsWindowConfiguration` proposed API
- SessionsDefaultConfiguration uses agentsWindow.default as the default value
- ReadOnly settings are excluded from user configuration parsing and
  cannot be written via updateValue
- Settings editor shows lock indicator for readOnly settings
- `@override:agentsWindow` filter in settings search (agents window only)
- Adopted all existing hardcoded session defaults to use the new schema

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* revert

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Fix stale BYOK models in model picker after API key removal

* Few fixes
…314599)

- Enable Search Editor contribution in the Agents window
- Extract search.searchEditor.* configuration properties from
  search.contribution.ts into searchEditor.contribution.ts
- Create search.common.contribution.ts for shared service registrations
  (ISearchHistoryService, IReplaceService, INotebookSearchService)
- Add Cmd+Shift+F keybinding to open Search Editor in Agents window
- Enable Problems panel (markers) with WindowEnablement.Both
- Fix panel part badge positioning in Agents window CSS

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…etions

agentHost: initial scaffolding out for completions
Disable doubleClickToSwitchToEditor and markEditorSelection by default
)

When 'Open in Agents Window' is triggered from the workbench, pass
the current workspace folder URI to the agents window and pre-select
it in the new chat workspace picker.

Flow:
- Action passes folderUri via openAgentsWindow API
- Main process sends vscode:selectAgentsFolder IPC to agents window
- Sessions contribution resolves folder via providers and selects it
- Waits for provider registration with Eventually phase timeout

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remote workspace folders (vscode-remote://) cannot be resolved by
sessions providers, so only pass file:// URIs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…session (#314596)

* sessions: add command to open events.jsonl for active Copilot CLI AH session

Adds a new command `agentHost.openSessionEventsFile` ('Copilot CLI: Open
Session Events File') accessible from the Command Palette. It opens the
`events.jsonl` file for the currently active Copilot CLI chat session.

Supported session types:
- Local AH (scheme `agent-host-copilotcli`): opens
  `~/.copilot/session-state/<id>/events.jsonl` via IPathService.userHome.
- Remote AH (scheme `remote-<auth>-copilotcli`): looks up the connection
  via IRemoteAgentHostService, uses the host's `defaultDirectory` (reported
  during AHP handshake) to build a `vscode-agent-host://` URI, served by
  the existing remote AH filesystem provider. No new RPC needed.
- EH CLI extension (scheme `copilotcli`): same local path as local AH.

The command is gated on `ChatContextKeys.enabled && IsAgentHostSession` so
it only appears when an AH session is active. The logic is in
`openSessionEventsFileActions.ts` (pure `resolveEventsUri` helper +
exported `Action2`) registered from `remoteAgentHost.contribution.ts`,
which is loaded on both desktop and web. Unit tests cover all cases.

(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* sessions: rename command to 'Open Copilot CLI State File', move under Developer category

(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Persist the user's last-selected session type and isolation mode so
they are restored when opening a new session, matching how the workspace
picker retains its previously selected folder.

Session type picker:
- Add IStorageService to SessionTypePicker and MobileSessionTypePicker
- Store selected type on pick, restore from storage when no session exists

Isolation picker:
- CopilotCLISession reads stored isolation mode as initial value
- CopilotCLISession.setIsolationMode() persists to storage on change
- Picker remains a pure UI widget with no storage dependency

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ke (#314610)

The first tokenizer use parses a ~3.6MB BPE file into a 200K-entry Map
(O200K_base.tiktoken), which takes ~225ms locally and several seconds on
slow CI machines. Because the tokenizer is a process-wide singleton,
this one-time cost lands on whichever test calls tokenLength first.

In summarization.spec.tsx that was 'continuation turns are not rendered
in conversation history' (the first test in the suite), which then
occasionally tripped vitest's 5s default test timeout on CI.

Warm the tokenizer once in beforeAll so:
- Per-test timing is predictable (281ms -> 36ms for the first test).
- The cold-start cost is paid in suite setup, where it would surface as
  a clear 'Hook timed out' error rather than a misleading test timeout.

Fixes #314078

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Close mobile sidebar drawer when creating a new session

On the agents mobile web layout, tapping the (+) buttons to create a new
session left the sidebar drawer covering the viewport, hiding the new
session view. Now the drawer is dismissed automatically:

- The (+) button in the mobile titlebar (workbench.ts).
- The per-workspace section (+) button inside the sessions list
  (NewSessionForWorkspaceAction).

Both call sites are gated on `isWeb && isMobile` to match the existing
`onSessionOpen` pattern in sessionsView.ts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address PR feedback: route mobile drawer close through proper path

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Clean up agenthost icon handling
Localized to the sessions provider

* agentHost: dedupe no-op root state actions

Skip envelope emission in AgentHostStateManager when a root action's reducer output deeply equals the previous root state. This prevents a feedback loop where a contribution re-publishes a root config value that already matches: the server would still fire a RootStateSubscription change, the contribution would react and re-dispatch, and so on.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* agentHost: narrow root no-op dedupe to RootConfigChanged

Per review feedback, only RootConfigChanged is dispatched as a true no-op (its reducer spreads values even when the patch matches). Other root actions like RootActiveSessionsChanged fire frequently (every turn start/complete) and always carry a real value, so the deep-compare was wasted work for them.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* agentHost: pre-check action patch to avoid no-op reducer allocation

Instead of running the reducer and post-comparing output, inspect the
RootConfigChanged action's patch against the current config values before
calling rootReducer. This avoids allocating a new state object entirely for
no-op dispatches, rather than allocating and discarding it.

(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* agentHost: fix merge-mode no-op check and add serverSeq assertions

- Merge-mode pre-check computes the merged result and deep-compares against
  current values, so a patch adding a new key (even with value undefined) is
  not mistakenly treated as a no-op
- Test now asserts serverSeq does not advance on deduped (no-op) actions

(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: flush pending status notification before session eviction

Race condition: _summaryNotifyScheduler debounces SessionSummaryChanged
notifications by 100ms. When _maybeEvictIdleSession calls removeSession
within that window after a turn completes, the session is removed from
_dirtySummaries before the scheduler fires. Clients never receive the
status=Idle notification and the spinner stays stuck.

Fix: in removeSession, flush any dirty summary synchronously before
clearing the session maps. This guarantees clients see the final status
even when the session is evicted within the debounce window.

For deleteSession (permanent removal), the forthcoming SessionRemoved
notification supersedes any summary diff, so dirty summaries are
dropped before removeSession is called to preserve the existing
"no spurious SessionSummaryChanged on delete" invariant.

 scheduler fired (status=InProgress

assert SessionSummaryChanged{status=Idle} emitted synchronously.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fixup: clarify removeSession JSDoc and remove unnecessary cast

Per Copilot review on #314608:
- JSDoc now clarifies removeSession won't emit SessionRemoved but may
  emit SessionSummaryChanged (synchronous flush side-effect)
- Remove 'as unknown as string' cast on _dirtySummaries. thedelete
  other delete calls on the same maps use session directly

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: add command to open events.jsonl for active Copilot CLI AH session

Adds a new command `agentHost.openSessionEventsFile` ('Copilot CLI: Open
Session Events File') accessible from the Command Palette. It opens the
`events.jsonl` file for the currently active Copilot CLI chat session.

Supported session types:
- Local AH (scheme `agent-host-copilotcli`): opens
  `~/.copilot/session-state/<id>/events.jsonl` via IPathService.userHome.
- Remote AH (scheme `remote-<auth>-copilotcli`): looks up the connection
  via IRemoteAgentHostService, uses the host's `defaultDirectory` (reported
  during AHP handshake) to build a `vscode-agent-host://` URI, served by
  the existing remote AH filesystem provider. No new RPC needed.
- EH CLI extension (scheme `copilotcli`): same local path as local AH.

The command is gated on `ChatContextKeys.enabled && IsAgentHostSession` so
it only appears when an AH session is active. The logic is in
`openSessionEventsFileActions.ts` (pure `resolveEventsUri` helper +
exported `Action2`) registered from `remoteAgentHost.contribution.ts`,
which is loaded on both desktop and web. Unit tests cover all cases.

(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* sessions: rename command to 'Open Copilot CLI State File', move under Developer category

(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* address Copilot review: use activeSession + clarify path comment

- Replace IChatWidgetService.lastFocusedWidget lookup with
  ISessionsManagementService.activeSession, matching the source of
  the IsAgentHostSession precondition so they cannot diverge.
- Reword buildRemoteEventsUri JSDoc: URI-path concatenation works on
  both POSIX and Windows hosts, not just POSIX. (Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* sessions: add command to collect agent host debug logs as zip

Adds a new 'Developer: Collect Agent Host Debug Logs' command that gathers all logs relevant to debugging agent host issues and packages them as a zip file.

Collected files:
- events.jsonl for the active Copilot CLI session
- IPC traffic output channel for the current session's agent host connection
- Agent host process log (local sessions only)
- Window log (rendererLog)
- Shared process log

The save dialog defaults to `ah-logs-<session-title>.zip`.

(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: move CollectAgentHostDebugLogsAction to electron-browser to fix layer violation

INativeHostService cannot be used from browser/ layer files. Extracted
the action to a new electron-browser/ file and register it from the
existing electron-browser chat contribution.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Pass session capabilities to chat parser (Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Stub chat sessions service in chat service tests (Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix comment typo and add agentIdSilent test coverage

Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/b7cba409-bf92-438f-adda-5d09865bc766

Co-authored-by: roblourens <323878+roblourens@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: roblourens <323878+roblourens@users.noreply.github.com>
DonJayamanne and others added 3 commits May 6, 2026 05:34
@pull pull Bot locked and limited conversation to collaborators May 6, 2026
@pull pull Bot added the ⤵️ pull label May 6, 2026
@pull pull Bot merged commit a9b3c39 into KingDEV95:main May 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.