Commit Graph
163765 Commits
Author SHA1 Message Date
justschen 5ff54cc2d0 Fix streamed fixed-scrolling title
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 6698ab91-2513-4857-a5cc-bd080bf813b6
2026-08-22 20:03:44 -07:00
justschen 88298007dc reasoning ux: fix fixed scrolling headers 2026-08-22 18:23:58 -07:00
Martin AeschlimannandGitHub f3fa55c39d update json-languageservice to 4.0.0-next.2 (#331964)
* update json-languageservice to 4.0.0-next.2

* remove jsonc-parser dependency
2026-08-22 14:09:57 +00:00
Justin ChenGitHubcopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
34a41e00d4 chat sticky scroll: more fluid, less vertical space (#332095)
* chat sticky scroll: more fluid, less vertical space

* cleanup

* fix tests

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-08-22 14:07:42 +00:00
8ed3e10734 Report recursive Agent Host turn usage telemetry (#332043)
* agentHost: report recursive turn usage telemetry

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

* agentHost: preserve inclusive usage for unmapped children

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

* agentHost: clean up completed subagent ownership

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

* agentHost: preserve subagent ownership for legacy usage events

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

* agentHost: trim comments to essentials

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

* agentHost: report spawning tool call id on subagent turns

Add parentToolCallId to agentHost.turnCompleted so a subagent turn joins
exactly to the languageModelToolInvoked row for the task call that spawned
it. Stable across resumed turns of the same subagent, undefined on roots.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-22 13:58:17 +00:00
Dmitriy VasyuraandGitHub f93bcab0c2 Add about:blank as explicit test for webPageLoader (#332102) 2026-08-22 13:49:09 +00:00
4fae990dca Agents - generate titles for untitled external sessions (#331985)
External sessions whose provider surfaces them without a title showed up
unnamed in the sessions list. Generate one from the user's first prompt,
reusing the existing rename infrastructure.

Adds a deferred-work lane on AgentService: `markStartupComplete()` is
signalled by the process mains, and work queued through
`_runWhenStartupSettled` runs once that and the first served session
listing have both happened. Background maintenance therefore never
competes with startup, and the service owns no ambient timer. The stale
external-session prune moves onto the same lane, replacing its 60s timer.

Discovery and legacy migration queue newly registered external sessions
that have no provider title. The job keeps the 2 most recently updated
candidates, reads the first user prompt from the default chat, and hands
it to `AgentHostSessionTitleController.generateExternalSessionTitle`,
which reuses the same utility-model prompt, cleaning, persistence, and
cancellation as first-message titling. Sessions that already carry a
persisted title are left alone, and a rename during generation cancels
it. Since these sessions are surfaced but not live,
`updateSurfacedSessionTitle` pushes the title onto the surfaced summary
so clients update in place.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-22 09:55:11 +00:00
CopilotGitHubcopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>benibenj
f704c7dede Hide the Changes pill for folderless chat sessions (#331971)
* Initial plan

* Hide the session Changes pill for folderless chats

Co-authored-by: benibenj <44439583+benibenj@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: benibenj <44439583+benibenj@users.noreply.github.com>
2026-08-22 09:22:53 +00:00
49f9fd4a28 sessions: disable unsupported editor splits (#331939)
* sessions: disable unsupported editor splits

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

* sessions: address split guard feedback

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

* test: clean up restored editor state

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

* sessions: isolate single-pane split guards

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-22 09:13:58 +00:00
0984c92074 sessions: streamline editor title actions (#331945)
* sessions: move diff preference to overflow

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

* sessions: simplify inline diff toggle

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

* sessions: move collapse diffs to overflow

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

* sessions: move code review to editor title

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

* sessions: enable code review in editor title

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

* sessions: move changes overflow to editor title

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

* sessions: gate editor title actions by visibility

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

* sessions: keep single-tab add action with title

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

* sessions: balance editor action separator spacing

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

* sessions: keep group header actions minimal

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

* sessions: separate add tab from editor actions

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

* editor: hide orphan layout action separator

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

* Revert "editor: hide orphan layout action separator"

This reverts commit cf817b16fc.

* editor: condition tab action separator on layout actions

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

* editor: require adjacent actions for separator

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

* sessions: balance single-tab separator spacing

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

* sessions: align Add Tab hover target

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

* sessions: address editor action review feedback

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-22 08:40:00 +00:00
1be3e73551 Pin complete Copilot request bodies in prompt snapshots (#332037)
test: pin complete Copilot request bodies

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-22 04:56:27 +00:00
9657ef29dc Adopt a sealed Agent Host service graph (#332036)
* Simplify AgentService composition

Narrow internal service dependencies, move runtime collaborators out of AgentService, and replace two-phase initialization with a constructor-complete composition. (Written by Copilot)

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

* Define Agent Host service ownership

Give the complete Agent Host service graph one disposable runtime owner and document workbench-style placement rules for bootstrap instances, shared orchestration services, and runtime activation. (Written by Copilot)

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

* Document Agent Host service construction

Add the target service-placement model and a tested sealable process-local service collection without enabling the seal in production yet. (Written by Copilot)

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

* Create Agent Host service foundation

Build callback, state, configuration, authentication, endpoint, proxy, and request foundations before telemetry and share the synchronous path with AgentService tests. (Written by Copilot)

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

* Register Agent Host bootstrap services

Migrate bootstrap-owned core and host services to local descriptors, eagerly resolve them under strict DI, and preserve typed test overrides. (Written by Copilot)

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

* Seal the Agent Host service graph

Migrate composition-owned and Copilot-dependent services atomically to local descriptors, resolve the complete graph eagerly, and reject late registrations. (Written by Copilot)

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

* Inject AgentService runtime dependencies

Make network diagnostics and edit attribution immutable AgentService dependencies and order test-graph teardown after composition-owned listeners. (Written by Copilot)

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

* Activate Agent Host contributions separately

Move changeset and completion registrations into an order-preserving post-graph activation phase with explicit disposable ownership. (Written by Copilot)

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

* Finalize the Agent Host service runtime

Resolve runtime services through DI, reduce the runtime facade, harden proxy and disposal invariants, and mark the service construction guide current. (Written by Copilot)

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

* Clarify Agent Host child service scopes

Define one primary runtime graph while allowing explicitly owned child instantiation services and scoped service collections when isolation requires them. (Written by Copilot)

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

* Document Agent Host service model debt

Separate stable service-graph contracts from accepted callback, worktree, foundation, concrete-type, and test-seam warts with explicit exit conditions. (Written by Copilot)

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

* Focus Agent Host bootstrap documentation

Rename the service guide, add maintenance rules, explain eager resolution as migration-risk control, and distinguish one primary graph from valid scoped child graphs. (Written by Copilot)

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

* Type customization worktree binding

Expose worktree binding as a narrow customization-enablement capability and remove the composition root's concrete implementation assertion. (Written by Copilot)

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

* Remove AgentService state manager escape hatch

Route tests through the composition-owned state manager and fix bootstrap cleanup ordering found during review. Clarify descriptor rules for trailing defaulted parameters.

(Written by Copilot)

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

* Dispose partial Agent Host contributions

Ensure activation failures clean up registrations created earlier in the contribution phase and cover the failure path with a focused test.

(Written by Copilot)

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

* Tighten sealed service resolution

Allow a sealed descriptor to be replaced only by an instance of its registered constructor, and reject unrelated implementations before descriptor resolution.

(Written by Copilot)

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-22 04:11:04 +00:00
Vijay UpadyaandGitHub 62ecd558f2 agentHost: don't report a session as missing while its catalog migration is in flight (#332080)
* agentHost: don't report a session as missing while its catalog migration is in flight

* feedback update
2026-08-22 03:40:36 +00:00
Dmitriy VasyuraandGitHub 00cc2df8db Fix hover on command status bar items (#332068) 2026-08-22 01:03:05 +00:00
roblourensandGitHub 150cf9472d Agent Host: Make debug log export best-effort (#332062)
Agent Host: make debug log export best-effort

Skip unavailable supplementary log sources and remove the debug-log byte limit while retaining manifest and entry-count validation.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-22 00:21:55 +00:00
Kyle CutlerandGitHub 2454591a48 Browser: never show query parameters in tab descriptions (#332058) 2026-08-22 00:04:55 +00:00
e6ac244843 Add Agent Host hung turn lifecycle diagnostics (#332045)
* Agent Host: add hung turn lifecycle diagnostics

(Written by Copilot)

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

* Agent Host: address telemetry review feedback

(Written by Copilot)

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-22 00:02:02 +00:00
Vritant BhardwajandGitHub c955978fc1 Merge pull request #332059 from microsoft/agents/vscode-issue-332031-investigation
chat: preserve conversation ID for BYOK Responses
2026-08-21 16:44:22 -07:00
45b04d5212 Disable Kerberos proxy smoke test on GitHub Actions (#332064)
(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-21 23:41:21 +00:00
86d7ed0c3d Agent Merge: recover from a checks fragment the host refuses (#332003)
* Agent Merge: recover from a checks fragment the host refuses

Agent Merge could hang indefinitely on a pull request whose checks
fragment was refused by GitHub, showing the user nothing at all.

When an organization enforces SAML SSO and the signed-in token is not
authorized for it, the checks GraphQL query is refused with HTTP 200 and
a FORBIDDEN error in the body. `CheckRun.checkSuite` is non-nullable, so
the refusal on the GitHub Actions data behind the workflow-name
subselection null-propagates and fails the whole fragment rather than
that one field. Checks then never load, the gate is permanently
indeterminate, and nothing surfaces:

- checks never loaded reads as pending, so the fragment held the fast
  poll cadence and re-requested a permanently refused query roughly once
  a minute, forever;
- indeterminate was the only gate outcome with neither an action nor a
  budget, so the session stayed resident with nothing to show;
- only `authentication` raised an auth requirement, so an `authorization`
  refusal never prompted the user to re-authorize.

Recover the fragment and make the failure legible:

- gate the workflow-name subselection and drop it for a repository whose
  host refuses it, keeping the checks themselves. Only the rollup request
  is retried, and an expected-check-suites refusal degrades to absent and
  incomplete, so neither is mistaken for the other;
- raise an auth requirement for `authorization` too, naming the
  organization and calling out SSO when GitHub reports it;
- give indeterminate a budget over continuously observed time, so a
  pull request that can never be read stops instead of idling while a
  turn or a sleeping host cannot exhaust it;
- name the fragment and its error in the indeterminate reason instead of
  one string shared by five fragments;
- back off persistent authorization failures, and stop an errored checks
  fragment from holding the fast cadence.

Partial check data is still never accepted, so a refused fragment
continues to fail closed rather than reporting checks it could not read.

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

* Request a credential when the snapshot records a refused fragment

Only the first refresh of a subscription reports a failure by throwing, so
raising the auth requirement from the evaluation catch missed the case it
was meant to cover: every later refusal is recorded on the snapshot and
read as an ordinary indeterminate gate, leaving the session waiting on a
credential the user was never asked for.

Detect a refused gate fragment on the snapshot and request a credential
there, once per distinct failure so a persistent refusal does not nag and
a failure after recovery can prompt again. Share one path with the throw
site, and keep the fragment list with the gate that defines it.

Also shorten the comments added with this change to the limits in the
coding guidelines.

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-21 23:31:37 +00:00
c66d8b3e45 launch skill: fix Windows launches always starting signed out (#332042)
* Fix launch.ps1 to discover Node.js from fnm

Add fnm directory fallback to Get-UsableNode so PowerShell launcher can find
Node.js installed via fnm when it's not on PATH. Tries PATH first (original
behavior), then checks AppData\Local\fnm_multishells for fnm-managed versions.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* launch skill: copy the shared-data-dir so Windows stays signed in

On Windows the GitHub session is stored at StorageScope.APPLICATION_SHARED
rather than APPLICATION - see useSharedStorage and CROSS_APP_SHARED_SECRET_KEYS
in src/vs/platform/secrets/common/secrets.ts. That puts the encrypted session
blob in <shared-data-dir>/sharedStorage/state.vscdb while the DPAPI-wrapped key
stays in <user-data-dir>/Local State.

The launcher copied the profile but handed Code OSS a brand-new empty
--shared-data-dir, so every Windows launch silently started signed out. Signing
in again did not help, because the new session was written to a shared dir that
the next launch discarded. macOS and Linux are unaffected: isWindows is false
there, so the same token lands inside the copied profile.

Seed the run's shared-data-dir from ~/<product.sharedDataFolderName>
(overridable with CODE_OSS_DEV_AUTHED_SHARED_DATA_DIR), and teach the auth
preflight to probe the shared database as well as globalStorage so its warning
is accurate. Also correct SKILL.md, which documented the macOS-only model and
recommended a remedy that cannot fix this on Windows.

Verified end to end: the launched Agents window authenticates against the real
service and completes a chat request without prompting for sign-in.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* launch skill: address review feedback on shared-data seeding

- Mirror the VSCODE_PORTABLE branch of IEnvironmentService.appSharedDataHome
  when resolving the source shared-data-dir, so a session created in portable
  mode is found instead of silently falling through to the product folder.
- Stop claiming a missing shared-data-dir means the launch will prompt for
  sign-in. ApplicationSharedStorageMain registers application storage as a read
  fallback, so profiles predating the APPLICATION_SHARED migration authenticate
  from globalStorage with no shared dir at all. Report the missing directory as
  a fact and let the combined preflight decide.
- Rewrite the SKILL.md callout that read as contradicting the remedy printed
  directly beneath it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
2026-08-21 22:56:55 +00:00
vritant24 43f74c456f chat: preserve conversation ID for BYOK Responses
Forward the conversation identifier through extension-contributed model options so Responses endpoints can generate prompt_cache_key.\n\nFixes #332031\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-21 15:40:24 -07:00
52131bf1b8 Simplify AgentService composition (#332035)
Narrow internal service dependencies, move runtime collaborators out of AgentService, and replace two-phase initialization with a constructor-complete composition. (Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-21 22:14:32 +00:00
aa1d29a951 agentHost: adopt AHP 1.0.0 breaking changes (#331999)
* agentHost: adopt AHP 1.0.0 breaking changes

Syncs the generated protocol types to AHP 1.0.0 and adopts the breaking changes in the agent
host, the workbench chat session handler, and the Agents window provider.

- Removes session-level forking. `CreateSessionParams.fork` and `SessionForkSource` no longer
  exist, so the fork configuration, its service plumbing, and the protocol forwarding are
  deleted. The editor-window Fork Conversation gesture now forks into a peer chat of the same
  session, which is how the Agents window already behaved. Chat-level forking does not change.
- Moves `ChatInputRequestPurpose` into the request `_meta` bag. The protocol no longer models
  the purpose, so a new helper writes and reads it. This keeps the ask-user telemetry and the
  elicitation classification.
- Replaces the terminal `exitCode` field with an explicit running/exited lifecycle. An exit
  without an exit code is now correctly an exit.
- Supplies the owning chat URI on each `TerminalSessionClaim`. The Copilot session runtime
  gives the chat URI to the shell tools, the non-pty output streams, and the local bang
  command, and the workbench records the owning chat for each observed terminal.
- Renames `SessionLifecycle.CreationFailed` to `SessionLifecycle.Failed`.
- Replaces the annotation `turnId` with an `origin` that holds the session, the chat, and the
  turn. Also corrects the persistence check, which discarded restored annotations.
- Adds `MethodNotFound` handlers for the new automation commands. This host does not advertise
  the automation capability.
- Corrects the test data that omitted the turn duration. The chat reducer now calculates
  `modifiedAt` from that duration instead of the local clock.

(Commit message generated by Copilot)

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

* sessions: correct the artifact location helper name

The image carousel entries called rtifactLocation, but the helper is named
sessionArtifactLocation. This broke the build on main.

(Commit message generated by Copilot)

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

* agentHost: address review feedback on the AHP 1.0.0 adoption

- Carries an explicit `hasExited` signal through `IChatTerminalOutputSource`. A command can now
  exit without an exit code, so chat must not read completion from the optional code.
- Rejects `session/workingDirectoryReplaced`. The action is client-dispatchable, but no provider
  advertises `primaryReplacement` and the host applies no backend side effect.
- Migrates annotations that were persisted before the origin change. Their records hold a
  top-level `turnId`, which the new check discarded as invalid.
- Derives the owning session for a shell terminal claim from the chat URI. The shell manager is
  constructed with a chat URI for a peer chat, so its own scope URI is not the session.
- Sends real timestamps from the end-to-end turn helpers. The chat reducer now calculates
  `modifiedAt` from the turn, so a fixed past `startedAt` made a peer chat look stale and removed
  its edits from the session changeset.

(Commit message generated by Copilot)

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

* agentHost: correct turn data in the protocol integration tests

The chat reducer now calculates `modifiedAt` from the turn action instead of the local clock, so
turn data that was previously ignored must be correct.

- Sends a real `startedAt` from the shared turn helper. A fixed past timestamp made a completed
  turn look older than the session that contains it.
- Supplies the required `duration` when the cancellation test cancels a turn. Without it the
  reducer calculates an invalid date, throws, and the cancellation never applies.

(Commit message generated by Copilot)

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

* agentHost: repair the merge of the AHP 1.0.0 adoption

The merge of main dropped a test helper call and did not apply the terminal lifecycle change to
the tests that main added, which broke the compile and one unit test.

- Restores `createTestAgentService` in the peer chat title test. The merge replaced it with a
  direct constructor call, whose arguments no longer match.
- Sets the terminal lifecycle on the two reconnect tests that main added.

(Commit message generated by Copilot)

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-21 22:09:36 +00:00
Ladislau SzomoruandGitHub e33d147d4c Agents - do not hide the action when showing the context menu (#332019) 2026-08-21 21:58:52 +00:00
08d4580568 fix: memory leak in settings preview indicator (#331990)
fix: dispose previous settings preview hover

Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>
2026-08-21 21:52:52 +00:00
eccac6a1a9 Respect auto-approve policy for reusable confirmations (#332039)
* chat: respect policy for reusable confirmations

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

* chat: preserve contributed confirmation actions

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

* chat: restrict approval preference management

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-21 14:43:39 -07:00
d181be19f6 sessions: stop picking the harness by which one has models (#332034)
* sessions: stop picking the harness by which one has models

The New Session composer replaced the user's harness with the first one
usable without GitHub, which in practice meant the first one that had
published models. Models arrive asynchronously, so a user who picked
Copilot or Codex while Claude was the only harness with a catalog watched
the pick snap back to Claude a moment later.

Drop that substitution. The stored preference wins, and the first harness
in the list is the default when there is no preference.

The draft is also recreated on every session-type change while an explicit
pick is set, even when the pick and the draft already agree. That was
invisible before because the recreate landed on a different harness, and
it is the churn that carried the snap-back. Give the pick branch the same
match check the no-pick branch already has.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* sessions: clear the upgrade watcher once the pick matches the draft

Address PR feedback:
- Once a servable pick already matches the draft, the watcher can no
  longer do anything, so clear it instead of leaving the listener
  registered holding the created session. This restores the lifetime
  the old fall-through to _createNewSession gave it.
- Condense the inline explanation to one line.
- Cover _createSessionNow's openNewSession arguments so a signed-out
  user's explicit pick cannot be substituted again unnoticed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-21 21:40:03 +00:00
92eacc5309 Add trace logging to the multi diff editor (#331992)
* Add trace logging to the multi diff editor

Adds a `MultiDiffEditorLogger` that traces the state transitions which are
hard to reconstruct after the fact when investigating multi diff editor bugs
such as the view jumping while scrolling or files being expanded even though
they were collapsed:

- view model/loading changes, collapsed state changes (no matter who caused
  them) and content height changes (annotated when they happen above the
  current scroll offset, which is what makes the view jump)
- programmatic scrolling (reveal, restored scroll state, scroll adjustments
  coming from an embedded diff editor)
- view state save/restore, including the active diff item, and editor
  set/clear input in both the multi diff editor and the sessions Changes
  editor
- navigation (go to next/previous change) and editor template acquire/release

The observers are only created while the log level is set to trace and are
disposed again when it is lowered, so nothing is observed in the default case.

Enable with `Developer: Set Log Level...` > `Window` > `Trace`.

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

* Address multi diff editor logging review feedback

- Log the decoded session resource instead of the synthetic
  changes-multi-diff-source: URI when the Changes editor input is set.
- Fall back to the authority or scheme in ormatUri, so pathless URIs
  no longer produce a blank label.
- Format diff item keys before logging them, so full URIs never leak into
  the trace when a persisted active item is missing.
- Guard the doc state aggregation in getViewState/setViewState with
  isEnabled, so large inputs pay no logging-only cost when tracing is off.

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-21 20:54:26 +00:00
2c8554af4f agentHost: make MCP SDK registration explicit (#332026)
* agentHost: make MCP SDK registration explicit

Separate Copilot MCP discovery routing from working-directory resolution so client-synced servers declare whether the SDK should discover them from a plugin or receive them in session config. Validate the client metadata that drives the decision and cover malformed and workspace-default cases.

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

* agentHost: make MCP SDK registration explicit

Make the Copilot MCP registration path observable at the SDK handoff.

- Record whether each MCP server uses plugin discovery or session config.
- Log the final configured and disabled server names at trace level.
- Avoid logging server URLs, headers, commands, environment values, or paths.

(Commit message generated by Copilot)

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

* agentHost: use the test service factory

Update the restored-chat test to construct AgentService through the shared test factory.

- Supplies the new service dependency through the existing test harness.
- Restores the client typecheck and Compile & Hygiene CI job.

(Commit message generated by Copilot)

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

* agentHost: test MCP projection trace privacy

Cover the trace-level MCP launch projection contract.

- Assert normal and ephemeral registration and disabled-server summaries.
- Verify that URLs, headers, commands, environment values, and paths stay out of the trace.

(Commit message generated by Copilot)

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-21 20:43:16 +00:00
26a6665d90 agentHost: Remove telemetry configuration service (#332007)
* agentHost: remove telemetry configuration service

Use the launch-resolved telemetry level when constructing Agent Host telemetry and preserve runtime consent updates through root config. (Written by Copilot)

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

* telemetry: preserve strict DI constructor typing

Keep the configuration-service constructor overload visible to strict instantiation while retaining the fixed-level Agent Host factory. (Written by Copilot)

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

* agentHost: preserve internal telemetry launch state

Forward the parent-resolved internal telemetry status so removing the settings-backed configuration service preserves telemetry.internalTesting. (Written by Copilot)

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

* agentHost: drop internal testing forwarding

Keep Agent Host internal classification based on the product domain check instead of adding a launch contract for the undocumented telemetry.internalTesting override. (Written by Copilot)

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

* agentHost: use test service factory

Update the newly merged AgentService test to use the shared factory after the constructor refactor. (Written by Copilot)

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-21 19:59:31 +00:00
73ceca55ca agentHost: fix Copilot chat fork leaking an in-flight turn (#332017)
* agentHost: fix Copilot chat fork leaking an in-flight turn

Fixes a race in Copilot chat forking. `_forkSdkChat` computed the SDK
fork boundary from a locally-mirrored SQLite column that is only filled
in after the next turn's `user.message` event streams back from the
SDK. If a user forked a turn while the following turn was still
in-flight, that column read as empty. The code treated an empty read
as "there is no next turn" and omitted the fork boundary entirely,
which silently copied the whole session, including the in-flight
turn's skill invocation and partial work, into the fork.

- Adds `CopilotAgentSession.waitForTurnEventId`, backed by a
  `DeferredPromise` on each `CopilotTurn`, so a fork can wait for the
  in-flight turn's event ID instead of skipping the boundary.
- Makes `CopilotTurn` a `Disposable` and `_currentTurn` a
  `MutableDisposable<CopilotTurn>`, so the turn's SDK event ID promise
  is rejected automatically whenever the turn ends, is superseded, or
  the session is disposed. This guarantees `waitForTurnEventId` always
  settles, so it needs no timeout.
- Updates `_forkSdkChat` to detect an active next turn via
  `currentTurnId` and wait for its event ID before forking, failing
  the fork outright if that turn never produces one.

(Commit message generated by Copilot)

* agentHost: snapshot active fork boundary before database read

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-21 19:59:22 +00:00
771cd9d5d7 Update chat in editor titles after rename tool (#331509)
* chat: update editor titles after rename tool

Fixes #331487

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

* chat: preserve single-chat rename titles

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

* chat: ignore rejected title actions

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

* chat: narrow editor title synchronization

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

* agentHost: synchronize default chat and session titles

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

* agentHost: preserve restored chat state during title snapshot

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

* agentHost: align default chat rename flows

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

* agentHost: preserve default chat title provenance

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

* agentHost: order default chat title snapshots

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-21 12:06:36 -07:00
Vijay UpadyaandGitHub eb95feb5ae agentHost: fix legacy Copilot CLI migration issues (opening, worktrees, archived state) (#331896)
* Handle archive session and add telemetry

* agentHost: keep migrated legacy CLI sessions matching by project root

* worktree fix and log update

* feedback updates

* Feedback updates

* test fix
2026-08-21 18:51:40 +00:00
roblourensandGitHub e6676d08ad agentHost: Use neutral protocol client name (#332006)
Rename RemoteAgentHostProtocolClient to AgentHostProtocolClient because the implementation is shared by local and remote agent host services.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-21 18:49:12 +00:00
Kyle CutlerandGitHub ec0c2dd6cd Refactor agentic browser opening lifecycle (#331996)
* Refactor agentic browser opening lifecycle

* feedback
2026-08-21 11:26:00 -07:00
Vritant BhardwajandGitHub 8d37f404b2 Merge pull request #332004 from microsoft/agents/log-analysis-error-fix-prioritization-58b68a87
Fix stale Agent Host turn completion to prevent response errors
2026-08-21 11:18:26 -07:00
c1ca63f5f5 Default to an installed build, and report missing video tooling (#331881)
* Default to an installed build, and report missing video tooling

Three problems surfaced running the skill from a fresh checkout.

Nothing ran without a target. With no flags the runner used the build from the
checkout, which only exists after compiling the product, so the documented
starting point failed to launch. Reproducing a reported issue means running the
shipped product anyway, so with no target flag it now finds an installed VS Code
Insiders (falling back to Stable) and logs which one it chose. `--dev` selects the
checkout build, and `--build` still pins an exact install.

A missing ffmpeg was only discovered after the run, as a raw ENOENT, and it threw
out of `runScenario` after the report had been written. The runner now checks for
ffmpeg and ffprobe before launching anything and prints the install command for
the platform, and caption rendering can no longer fail a run that has already
produced its evidence.

The window did not fill the recording. The canvas is 1920x1080 while VS Code
sizes its own window (1440x900 with a workspace, 1200x800 empty), so the capture
showed the window in the top-left corner surrounded by dead space. The window is
now sized to the canvas once recording is on; a window larger than the display
still renders at that size, so this holds on smaller screens.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: adb443eb-11e5-40a1-8608-7f593fa79485

* Find an installed ffmpeg, pace the steps, and classify blocked steps

Follow-up to the same skill run.

Captions were missing even though ffmpeg was installed. A PATH edit only reaches
processes started afterwards, so an editor that was already running never sees
it, and the runner concluded ffmpeg was absent. It now looks in the usual install
locations as well as PATH, which is the difference between an annotated recording
and a raw one on a machine that already has ffmpeg.

Steps flowed past too quickly to read. A caption is only legible for as long as
its step is on screen, and steps that assert rather than type can complete in a
few hundred milliseconds. Each finished step is now held briefly, controlled by
`stepPauseMs` and disabled with `0` for timing-sensitive scenarios.

Steps that cannot be automated were indistinguishable from ones that were merely
unavailable. `skip` now takes `needs: human` or `needs: infrastructure`: the first
means a person has to check it, the second means the harness could do it but
cannot yet, which is an enhancement request rather than a permanent limit. The
distinction is recorded in the manifest, highlighted in the report, shown on the
video caption, and printed at the end of the run.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: adb443eb-11e5-40a1-8608-7f593fa79485

* Report the quality of the build that ran, and finish the target options

Review follow-ups.

The evidence labelled every installed run `Dev`. Quality was read from the
environment, which only describes a build made from this checkout, so a run
against installed Insiders was reported as Dev in both the manifest and the
report - the evidence named the wrong product. An installed build stamps its own
quality in `product.json`, so that is now the source when a build path is given.
This also corrects `--build`, which had the same problem before this change.

Linux missed Snap installs. Snap keeps the app under a read-only revision root,
so a machine with VS Code installed only through Snap found nothing and fell back
to the unbuilt checkout - the exact failure the new default exists to avoid.

The web launcher recorded 1920x1080 while sizing the page to 1440x900, so the
no-empty-margins claim did not hold there. It now matches the canvas while
recording and keeps its established size otherwise, so smoke runs are unchanged.

`--dev` was accepted but undocumented in the runner's own help, which now lists
all three targets.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: adb443eb-11e5-40a1-8608-7f593fa79485

* Detect a staged update instead of timing out

VS Code on Windows applies a downloaded update by swapping the executable during
startup, so a launch attempt exits before showing a window. Playwright then waits
the full launch timeout and reports that the process "likely crashed or hung",
which sends the reader looking for crash dumps that do not exist.

Insiders downloads an update most days, so anyone reproducing an issue will meet
this. A `new_<exe>` beside the target is the marker, and checking for it turns a
60s misleading timeout into an immediate statement of the cause and the fix.

Confirmed the launch failure is environmental rather than harness behaviour: a
bare Playwright launch of the same installed build, with none of this code in the
path, also never receives a window while the update is staged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: adb443eb-11e5-40a1-8608-7f593fa79485

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: adb443eb-11e5-40a1-8608-7f593fa79485
2026-08-21 18:13:57 +00:00
Anthony KimandGitHub 9b7657cd98 Dispose AgentHostPty on terminal shutdown, exit, and detach (#331908)
* Dispose AgentHostPty on terminal exit

* Dispose AgentHostPty with its terminal instance

* Align AgentHostPty disposal with terminal precedent

* Let reconnect supersede a pending AgentHostPty startup
2026-08-21 11:11:35 -07:00
Vritant BhardwajandGitHub 02dd2d3038 Merge branch 'main' into agents/log-analysis-error-fix-prioritization-58b68a87 2026-08-21 11:02:47 -07:00
8f4fc8d327 chat: identify Agent Host telemetry sessions (#332000)
* chat: identify Agent Host telemetry sessions

Adds a session-mode property to chat request, user-action, edit, and follow-up telemetry. This lets telemetry split Agent Host sessions from legacy sessions, including local fallback sessions.

- Adds isAgentHostSession to workbench chat telemetry events.\n- Adds whole-file edit outcomes and tags hunk outcomes.\n- Tags shared accepted and rejected edit telemetry.\n- Adds focused tests for Agent Host and legacy telemetry values.

(Commit message generated by Copilot)

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

* chat: tag code block telemetry sessions

Tags sidebar code-block telemetry with the actual session mode. Corrects the remaining-edits value for user-modified file outcomes.

- Shares Agent Host session resource detection.\n- Tags code-block suggestions and acceptance actions.\n- Reports pending edits when users modify a reviewed file.\n- Extends focused telemetry coverage.

(Commit message generated by Copilot)

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-21 17:56:37 +00:00
eb6755c072 Remove flaky session artifact image tests (#331998)
* Remove flaky session artifact image tests

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

* Fix session artifact image location helper

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-21 17:41:30 +00:00
Vritant BhardwajandGitHub 8685afa5ff Merge branch 'main' into agents/log-analysis-error-fix-prioritization-58b68a87 2026-08-21 10:37:29 -07:00
vritant24 0c29c285ee Agent Host changes for agents/log-analysis-error-fix-prioritization-58b68a87 2026-08-21 10:15:26 -07:00
e1801a0535 Implement paste threshold adjustment and "Insert in Prompt" feature (#331978)
* Agent Host changes for lramos15/agents/vscode-issue-331852-proposal

* Refactor chat input and attachment components for improved performance

- Remove unused code from agentHostInputCompletions and newChatContextAttachments.
- Optimize chatInputPart and chatAttachmentWidgets for better efficiency.
- Update tests for newChatInputPaste to reflect changes in functionality.

* Fix undefined artifactLocation in session artifact images

The image section called `artifactLocation`, but the helper is named
`sessionArtifactLocation`, as the five other call sites use. This broke
compilation and threw `ReferenceError` from the two Session Artifacts
tests that build an image section.

Introduced by #331946 and present on main.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b8277a07-8be3-4c23-a886-ba92a9c4cac0

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b8277a07-8be3-4c23-a886-ba92a9c4cac0
2026-08-21 16:58:25 +00:00
6a6f46483e Refactor inline survey and ask question tool CSS into shared components (#331975)
* chat: extract a shared large-card primitive for inline cards

Chat has two card tiers. `.chat-confirmation-widget2` is the medium tier and
already had a name; the large tier -- rounded border, panel background, clipped
content, plus a 22px chrome free icon button -- was open coded in four places.
`chatPlanReview.css` made this plainest by taking the medium tier primitive and
overriding it back up to the large one with the same six declarations the
survey and the question carousel open coded.

Name that tier. `chatCard.ts` owns the stylesheet so its position in the bundle
is deterministic rather than decided by module graph order, and exports the
class names plus a `createChatCardIconButton` helper.

The nine icon button copies all carried `!important`, because `Button` writes
its colors as inline styles that no selector can outrank. Rather than move the
`!important` into the shared file, build these buttons with no color options at
all: `Button` then writes empty strings and the stylesheet owns the appearance.

Removes 228 lines of duplicated CSS for 103 shared ones. The one rendering
change is in the question carousel title, which asked for
`--vscode-agents-fontWeight-semiBold`; that token is registered by
`workbench.common.main.ts` but not by the component fixture harness, so the
title fell back to 400 there instead of the intended 600. The generic token is
also the correct one for `workbench/contrib` per the design token guidance.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 14187097-e970-4d2b-8d7c-cfa8c5aa6306

* chat: fix silent arrow key navigation in the question carousel

The single select list mixed two ARIA focus models. It declared
`aria-activedescendant` on the listbox, but auto focus moved real DOM focus to
an option, and arrow keys only updated `aria-activedescendant` without moving
focus. `aria-activedescendant` is only honoured on the element that actually
has DOM focus, so arrowing through options announced nothing to a screen
reader. Focus the listbox instead, which is the element that declares it.

Multi select is left alone: it uses real focus on the item and never sets
`aria-activedescendant`, so its model is already coherent.

Focusing the list also revealed that the rule meant to indicate a focused list
never applied. It was nested inside `.chat-question-list` while also naming
that class, so it compiled to a list inside a list. With `outline: none` set on
both the list and its items, that left keyboard users with no focus indicator
at all on this list. Anchor it with `&` so the selected row picks up active
selection colors while the list has focus, matching the survey and the rest of
the workbench.

Adds characterization tests for the list's keyboard contract -- arrow clamping,
digit selection, digit past the last option moving to freeform, and where focus
and `aria-activedescendant` actually land.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 14187097-e970-4d2b-8d7c-cfa8c5aa6306

* chat: share the listbox ARIA scaffolding between the card lists

The question carousel and the model feedback survey each hand roll a listbox,
and each has to keep three things in agreement: the class that paints the
active row, `aria-selected` on every option, and `aria-activedescendant` on the
container. Keeping that in step by hand is what produced the carousel bug fixed
in the previous commit, and it is silent when it breaks.

`ChatCardListbox` owns exactly that: option registration, the three way state
sync, and focus. Focus is only handed out through `focus()`, which puts it on
the container, so the invariant that makes `aria-activedescendant` work is
enforceable rather than conventional.

Keyboard handling and row rendering stay at the call sites. The survey wraps at
the ends and supports Home/End; the carousel clamps and binds digits; arrowing
commits in the carousel but not in the survey. Those are product differences,
not duplication, and folding them into option flags would have produced two
widgets wearing one name -- so the shared piece is deliberately narrow and
`clampedIndex` / `wrappedIndex` are offered rather than imposed.

This trades a small net line increase for a single place where the announcement
contract can be got right. The option element id format changes as a result; it
is internal and only referenced by `aria-activedescendant`.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 14187097-e970-4d2b-8d7c-cfa8c5aa6306

* chat: adopt the shared card on the tool confirmation carousel

This was the one large card left open coding its own chrome. It kept a
`transparent` border fallback while the other three fall back to
`chat-requestBorder`, which is why it was held back from the earlier
extraction.

That difference is drift rather than intent. The fallback dates from the
original design, where the carousel was fused to the chat input: no bottom
border and a top only radius. It later gained a full border and a full radius
but kept the fallback. More decisively, `input.border` is null only in dark and
light and resolves to `contrastBorder` in both high contrast themes, so all four
cards already agree in high contrast and diverge only in dark and light. A
deliberate borderless treatment would hold across themes.

So converge instead of adding a modifier: the carousel now shows the same
hairline as its siblings in dark and light, and is unchanged in high contrast.

Also drops the duplicated agents/editor background override and the header
actions block, which matched the shared one on all four declarations.

The overlay header keeps its own padding and centre alignment. It is a compact
bar for a collapsed carousel rather than a titled card header, so folding it
into the shared header would be a real visual change for no structural gain.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 14187097-e970-4d2b-8d7c-cfa8c5aa6306

* chat: make the large card tier win where it composes with the medium tier

Plan review carries both tier classes on one element. Its old rule set the
large shell at four classes of specificity, which beat
`.chat-confirmation-widget2`; the shared `.chat-card-large` only ties it, so the
medium tier was winning on stylesheet order and the card had regressed to a 6px
radius and the request border. Name both classes together so the outcome does
not depend on load order.

Also puts the header separator on `var(--vscode-strokeThickness)` to match the
shell border, and condenses the listbox and focus comments to the constraint
that is not obvious from the code.

The carousel test helper now defines `keyCode` on the event rather than passing
it through the init dict. Chromium does accept it there -- the navigation
assertions were exercising the intended branches -- but it is non-standard and
needed a cast, so this matches the survey test helper instead.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 14187097-e970-4d2b-8d7c-cfa8c5aa6306

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 14187097-e970-4d2b-8d7c-cfa8c5aa6306
2026-08-21 16:36:40 +00:00
1be2c3cf89 Allow toggling chat pills that have no data (#331977)
The pill visibility context menu disabled the toggle entries for kinds the
session reports no data for. They already sit in their own group below the
kinds with data, so keep the grouping but let them be toggled.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-21 15:35:33 +00:00
1659d8dba1 sessions: Centre the chat pill chevron on the compact glyph (#331893)
The dropdown affordance used `chevron-down`, whose ink is drawn above the
middle of the pill's 12px glyph slot, and leaned on a `translateY(1px)` nudge
to reach the label's optical centre. Use `chevron-down-compact` instead -- the
glyph the workspace, session type and automation dropdown triggers already use
-- which is drawn on the box centre and so lands on the label without a
transform.

Drop the substring class matchers on the two glyph rules, which defeat Blink's
per-class invalidation, and share the artifact location helper with the pill
debug overlay rather than rebuilding the same hover, aria and tooltip values.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-21 17:14:23 +02:00
041fc2c244 Fix stale isActive causing background tabs to be reported as activeTab (#331952)
* Clear stale isActive on tabs that are no longer active

`_onDidTabActiveChange` marked the newly active tab's cached DTO as active
but never cleared the flag on the tab that was active before. Since the
label, dirty, pin and preview handlers patch a single field and re-send the
whole cached DTO, updating a *background* tab shipped a stale `isActive:
true` to the ext host, which then repointed the group's active tab at a tab
the user never switched to.

The effect was that changing a background webview panel's `iconPath` or
`title` (or its dirty/pin/preview state) silently flipped
`tabGroups.activeTabGroup.activeTab` to that background tab, with no change
to what the workbench actually renders or focuses.

Fixes #331914

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

* Keep the two cached tab DTO copies in sync

The MultiDiff resources listener replaced `tabInfo.tab` with a freshly built
DTO, but the group's `tabs` array still referenced the original object. Once
those two caches diverged, clearing `isActive` while iterating the group array
left the replacement DTO in `_tabInfoLookup` untouched, so a later label,
dirty, pin or preview update on a background multi diff tab could still ship a
stale `isActive: true` to the ext host.

Refresh the DTO in place instead so both caches keep pointing at the same
object and cannot drift apart.

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-21 15:02:07 +00:00
eda7826c94 Render the session changes pill from a cache (#331970)
* Render the session changes pill from a cache

A session reports its changes late, so its changes pill only appeared some
time after the session was opened. Remember the pill last shown for a
session in a bounded, globally stored cache (30 entries, oldest evicted
first) and render it optimistically until the session reports its own
changes.

Co-authored-by: Copilot <223556219+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>

* 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>
2026-08-21 14:27:17 +00:00