Commit Graph
160445 Commits
Author SHA1 Message Date
Ulugbek AbdullaevandCopilot App 3073c2bb48 NES: experiment-driven global token budget for the inline-edits prompt (#323948)
* nes: fold currentFile budgeting into the global budget cascade

Under the opt-in global budget experiment, the current file now draws its
clip budget from the shared pool (its `shares.currentFile` slice of
`totalTokens`) and donates whatever it does not use to the cascade as the
initial surplus. When the global budget is disabled (prod default) behavior
is byte-identical, and the new defaults (totalTokens 8000, shares in eighths)
reproduce today's per-part `maxTokens` caps exactly.

- xtabPromptOptions: add `GlobalBudgetSharePart`, `currentFileBudget()` and
  `validate()`; grow `shares` to include `currentFile`; bump
  `DEFAULT_TOTAL_TOKENS` to 8000 and rebalance `DEFAULT_SHARES`.
- promptCrafting: seed the cascade's initial surplus from the current file's
  leftover budget; delegate validation to the namespace helper.
- xtabProvider: size and clip the current file from the pool and compute the
  surplus, gated on `globalBudget` being defined.
- Tests: volume-neutral invariant, `currentFileBudget`/`validate` units, and
  provider-level regression + new-behavior coverage.
- Docs: rewrite globalBudgetCascade.md for the seeded-surplus design.

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

* nes: collapse global-budget settings into a single exp-driven JSON string

Replace the two experiment-driven global-budget settings
(globalBudget.enabled boolean + globalBudget.totalTokens number) with a
single JSON-encoded string setting, modelled after modelConfigurationString,
that defines totalTokens, order, and shares together.

- configurationService: remove InlineEditsXtabGlobalBudgetEnabled and
  InlineEditsXtabGlobalBudgetTotalTokens; add InlineEditsXtabGlobalBudget
  (string | undefined, ExperimentBased, default undefined).
- xtabPromptOptions: add GlobalBudgetOptions.VALIDATOR (all top-level fields
  optional; shares must be complete when present) and a pure
  GlobalBudgetOptions.fromConfigString(): Result<GlobalBudgetOptions, string>
  that JSON-parses, structurally validates, merges over the defaults, then
  runs the semantic validate(). Never throws.
- xtabProvider: inject ITelemetryService; resolve the budget via
  getGlobalBudget(), returning undefined (disabled, identical to prod) when
  the string is unset/empty/invalid and emitting incorrectNesGlobalBudgetConfig
  telemetry on parse/validation failure.
- Tests: migrate the provider global-budget tests to the JSON string and add
  fromConfigString unit tests.
- Docs: rewrite the globalBudgetCascade.md Wiring section and migration note.

No regression: an unset string keeps the byte-identical legacy path. '{}'
enables the budget with the volume-neutral defaults; {"totalTokens":N} only
overrides the pool size.

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

* nes: clip the current file last under a global budget to reuse cascade leftover

Under a global budget the current file is now clipped LAST, sized to its base
share plus whatever the budget cascade left unused (`currentFileBudget +
finalSurplus`), so it trims less and reuses leftover budget. The cascade runs
first (seeded with 0, the current file never donates) and is threaded into
`getUserPrompt` via `precomputedCascade` so it renders exactly once.

This replaces the earlier two-mode design: the opt-in `reuseLeftoverForCurrentFile`
flag and the seeded-surplus "donate-forward" path are dropped, along with all
`currentFileBudgetSurplus`/`initialSurplus` threading. Clip-last is now the single
behavior under a global budget. The validator hardening (rejecting non-finite or
negative `totalTokens`/shares) is kept.

No production regression: when `globalBudget` is undefined the current file is
still clipped to its own `currentFile.maxTokens` with the legacy await ordering,
byte-identical to before. The global budget remains experiment-gated and off in
prod.

Tests and globalBudgetCascade.md updated for the clip-last-only behavior.

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

* nes: address review — restore nLinesOfCurrentFileInPrompt telemetry timing

- xtabProvider: record setNLinesOfCurrentFileInPrompt inside both budget
  branches. In the legacy/prod branch the clip happens before the
  context-gathering awaits, so the telemetry call is moved back there to
  match prod timing exactly (it is still emitted when a request is
  cancelled mid-gathering). The clip-last branch records it after the
  cascade, as the clip is inherently last there.
- xtabPromptOptions: fix two stale JSDoc blocks that still described the
  removed donate-forward behavior; describe clip-last instead.
- globalBudgetCascade.md: correct the conservation bound to T·(Σ shares)
  and document the share-sum tolerance (over-allocation ≤ ~1e-3·T).
- promptCrafting.spec: add a cascade test asserting finalSurplus shrinks
  as the cascade consumes budget (current file reuses less leftover).

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

* nes: fix stale DEFAULT_ORDER doc comment to say clip-last

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

* nes: rename clipCurrentFileToBudget param to overriddenMaxTokens

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

* nes: extract current-file clip + context gathering into a method

Pulls the ~55-line global-budget/legacy if-else out of doGetNextEditWithSelection
into a private gatherContextAndClipCurrentFile method returning
Result<{ clippedTaggedCurrentDoc, areaAroundCodeToEdit, precomputedCascade,
langCtx, neighborSnippets }, NoNextEditReason>. Behavior, clip-first/clip-last
ordering, and nLinesOfCurrentFileInPrompt telemetry timing are unchanged.

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

* nes: recalibrate global-budget defaults to merged currentFile cap (1500)

main (#322382) lowered currentFile.maxTokens 2000->1500, which broke the
global-budget 'volume-neutral defaults' invariant (floor(total*share) must
equal each part's legacy cap). Recalibrate DEFAULT_SHARES to cap/7500 and set
DEFAULT_TOTAL_TOKENS to 7500 (the sum of the merged per-part caps: 1500 + 2000
+ 2000 + 1000 + 1000), so shares still sum to exactly 1 and every part's base
allocation reproduces its cap. finalSurplus stays 6000 (7500 - 1500).

Update dependent specs (literal 8000 -> DEFAULT_TOTAL_TOKENS, stale 2000 cap
comments -> 1500) and the design doc (defaults table, worked examples, effective
caps, ordering caveat, migration note) for T=7500 and currentFile base 1500.

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 16:48:34 +00:00
Martin Aeschlimann 881d17aced Chat customizations contains content of deleted files (#324067)
* Chat customizations contains content of deleted files

* update

* update
2026-07-02 16:45:55 +00:00
Martin AeschlimannandCopilot Autofix powered by AI 1ae8d99906 Skills in user dir do not show up in the chat input (#324030)
* Skills in user dir do not show up in the chat input

* 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>

* fix tests

* fix cleanHomeFolder

* update

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-02 16:41:56 +00:00
Sandeep SomavarapuandCopilot 7207f731a4 sessions: improve subagent 'Open Subagent' pill in Agents window (#324068)
* sessions: improve subagent 'Open Subagent' pill in Agents window

Reworks the subagent pill shown in the inline subagent block so it reads as a
single, identifiable chip in the Agents window:

- Move the pill to the start of the subagent header row so it keeps a fixed
  position instead of shifting as the streaming title grows.
- Show the subagent chat's own title as the pill label (resolved reactively via
  findSubagentChat) and hide the now-duplicate inline header title.
- Prefix the pill with the subagent's agent name (e.g. 'General-purpose',
  'Task'), forwarded on the toolbar context, falling back to 'Subagent'.
- Show a progress spinner in place of the leading conversation icon while the
  subagent is still running, driven purely by CSS off the existing
  chat-thinking-active state.
- Render the pill as a standalone chip (OpenSubagentChatActionViewItem now
  extends BaseActionViewItem) styled like the chat file/diff pill, instead of
  the filled secondary-button meta pill whose inline-style foreground CSS
  cannot override.

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

* sessions: address review feedback on subagent pill

- Shorten the over-long inline comment and the OpenSubagentChatActionViewItem
  JSDoc per coding guidelines.
- Set role=button on the chip's action-item element and keep aria-disabled in
  sync with action.enabled so screen readers treat it as an actionable control.

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 15:27:02 +00:00
Ladislau Szomoru 7630251ebd Agents - always show actions in the multi-file diff editor (#324058) 2026-07-02 14:23:38 +00:00
Sandeep SomavarapuandCopilot 165ec3783a sessions: collapse Pinned and Chats sections on first open (#324055)
The Pinned and Chats sections in the Agents window sessions sidebar
previously defaulted to expanded. Default their collapse state to
collapsed on first open (when no saved state exists) while continuing to
persist and honor the user's later expand/collapse choice.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 14:12:35 +00:00
Benjamin Christopher SimmondsandCopilot 4090e86ce8 sessions: show file icons in Session Files changes list (#324053)
The Session Files list in the Changes view did not render per-file-type icons because its list was placed outside the file-icon themeable scope. Add a file-icon themeable scope to the SessionFilesWidget root node and align its resource label rendering with ChangesTreeRenderer (strikethrough for deleted files). Also document the show-file-icons requirement in best-practices.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 13:45:59 +00:00
Don Jayamanne faf79f7c6b Enhance CopilotSlashCommandCompletionProvider with session customizations and improve command handling (#323931)
* Enhance CopilotSlashCommandCompletionProvider with session customizations and improve command handling

* Refactor CopilotSlashCommandCompletionProvider to remove unnecessary session check in _getKnownSkills and ensure sessionInfo is always accessed safely

* Update commandListCalls in CopilotAgentSession tests to include skills
2026-07-02 13:36:04 +00:00
469425b939 AgentHost - chat working directory fix (#324036)
* AgentHost - chat working directory fix

* AgentHost - fix the root cause: default chat should not seed a workingDirectory

Per the protocol, a chat's `workingDirectory` is an OVERRIDE — when absent the
chat inherits the session's working directory. `createDefaultChatSummary` was
seeding the session default onto every chat as a fake override, which then went
stale when the session's working directory was resolved later (e.g. a worktree
resolved at materialization), and the per-chat projection surfaced the
pre-materialization directory over the resolved session default.

Stop seeding `workingDirectory` in `createDefaultChatSummary` so inheriting
chats keep it undefined and the projection's fallback always uses the current
session working directory. This removes the need for the default-chat
working-directory sync and covers all inheriting chats (not just the default).

Adds a regression test.

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

---------

Co-authored-by: Sandeep Somavarapu <sasomava@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 13:10:11 +00:00
Benjamin Christopher Simmonds 92a789a818 Merge pull request #324037 from microsoft/benibenj/breezy-amphibian
Make onboarding tours ready for experiment
2026-07-02 15:05:26 +02:00
Benjamin Christopher SimmondsandCopilot ce57a540ec chat: use comment icon for comment tools in thinking widget (#324040)
Render the comment codicon as the chat-thinking-icon for comment tools (addComment, listComments, etc.) instead of the generic tool icon, and drop the now-redundant inline comment icon from the addComment invocation message. Also bump the addComment preview length from 20 to 40 characters.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 13:02:23 +00:00
Benjamin Christopher SimmondsandCopilot 6162ed61f7 sessions: tweak session files widget in changes view (#324034)
* sessions: tweak session files widget in changes view

- Use default ResourceLabels (no supportIcons) so file icons render
- Drop the resource path from the file description
- Only open a diff for modified files when the original has content
- Show A/M/D change decoration badges like the changes view
- Remove strikethrough for deleted files
- Add an Open File action to the row toolbar matching the changes view

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

* sessions: remove file count from session files header

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 11:41:32 +00:00
Aiday Marlen Kyzy 4c95ca4223 fix: adding related information to accessible content (#324031) 2026-07-02 11:38:28 +00:00
BeniBenj abea2ef515 make tours ready for experiment 2026-07-02 12:56:59 +02:00
Aiday Marlen Kyzy b9b8fad2e1 fix: telemetry error (#324027) 2026-07-02 12:34:19 +02:00
John MurrayandAlex Ross 139c79411c Reinstate colors of symbol codicons when used in custom tree views (#320391)
* Reinstate colors of symbol codicons when used in custom tree views

* Attestation commit

* Attestation commit

* Attestation commit

* Attestation commit

---------

Co-authored-by: Alex Ross <38270282+alexr00@users.noreply.github.com>
2026-07-02 10:15:24 +00:00
Benjamin Christopher SimmondsandCopilot dce300ee2c Reopen bulk-closed editors together (#324026)
When multiple editors are closed at once (Close All Editors, Close Others, etc.), Reopen Closed Editor now reopens them all as a batch instead of one at a time.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 10:11:18 +00:00
Sandeep SomavarapuandCopilot c9658c4616 sessions: add icon + always-visible placeholder to Pinned section (#324023)
Give the Pinned section a leading pin icon (mirroring the Chats section's
chat icon) and make both section headers share the standard section-header
font/styling. Also keep the Pinned section always visible with a
"No pinned sessions" placeholder when empty, matching the Chats section.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 10:09:44 +00:00
Benjamin Christopher SimmondsandCopilot 9ff77d1b0f sessions: add diagnostics for per-session PR icon polling (#323868)
Non-active agent-host session PR icons don't refresh until the session is activated. The per-session poller in GitHubPullRequestPollingContribution keeps a shared PR model warm only once its identity resolves, but the previous trace collapsed all four bail-out stages into one generic message and gave no visibility into how many sessions were actually tracked.

Disambiguate the identity derivation into a discriminated PullRequestIdentityState (ok / archived / no-workspace / no-git-repository / no-pull-request) and log the precise stage where a session's PR model is not kept warm, plus the total tracked poller count on each sessions change. Behavior is unchanged; only the 'ok' state starts polling as before.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 12:05:54 +02:00
Sandeep SomavarapuandCopilot ecea6479fc sessions: hide subagent chats by default, persist closed chats, add chat capabilities (#324021)
sessions: hide subagent chats by default, persist closed chats, and add chat capabilities

Improves chat management in the Agents window session view:

- Subagent (tool-origin) worker chats are hidden from the chat tab strip by
  default and surface as a tab only when explicitly opened (e.g. from the
  Subagents dropdown); closing one hides it again without adding it to the
  reopenable closed set. Reverts on reload.
- Closing a chat is remembered across reload/restart (closed-chat set is
  persisted per session and restored on startup); subagents are excluded from
  the persisted set.
- Adds "Close All Chats" command (Ctrl/Cmd+K W, mirroring "Close All Editors in
  Group"), gated on SessionHasMultipleOpenChats so it targets the focused
  session and does not collide with "Close All Sessions" (Ctrl/Cmd+K Ctrl/Cmd+W).
- Introduces per-chat IChatCapabilities (canRename/canDelete) with a central
  getChatCapabilities resolver that folds in the main-chat invariant (never
  deletable). Subagent chats report neither rename nor delete; the tab context
  menu, delete keybinding, and context keys now go through capabilities instead
  of ad-hoc origin/main-chat checks.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 09:44:13 +00:00
Dmitriy Vasyura 5334b03810 Fix flaky unit-test test (#324017) 2026-07-02 09:09:15 +00:00
Lee Murrayandmrleemurray f38422a02e Style overrides: Update border-radius for editor and sidebar styles (#324016)
Update border-radius for editor and sidebar styles to enhance UI consistency

Co-authored-by: mrleemurray <mrleemurray@users.noreply.github.com>
2026-07-02 09:05:46 +00:00
Dmitriy Vasyura fa3d60dc55 Support uninstalling extensions from Tools section of Chat Customizations (#323981)
* Support uninstalling extensions from Tools section of Chat Customizations

* PR feedback
2026-07-02 08:51:33 +00:00
Alex Ross 282e6f3ec1 Fix smoke test pipeline (#324013)
* Add copilot stage

* add counter
2026-07-02 08:49:55 +00:00
Martin Aeschlimann 021b5d7fdb Showing skill description in chat input is noisy (#324009) 2026-07-02 08:45:01 +00:00
Dmitriy Vasyura 0417029470 Filter extension gallery results in Tools view (#323986) 2026-07-02 08:31:52 +00:00
Dmitriy Vasyura 2529ca8e29 Add Tools tree keyboard navigation, fix focus outline cut-off at widget edges (#323984)
* Add Tools tree keyboard navigation, fix focus outline cut-off at widget edges

* PR feedback
2026-07-02 08:31:26 +00:00
Anthony Kim 10341f245a Support Agent Host session attachments with Copilot CLI events.jsonl (#323773)
* support session reference attachment

* Bound session reference transcript attachments

* Address session reference review feedback

* reanming

* Try with preview, targetted event jsonl + session uri

* Scope Agent Host session references to Copilot CLI trajectories

* revert unneeded changes

* rename

* update wording efurther

* less cli specific

* give await back
2026-07-02 01:29:29 -07:00
Ladislau Szomoru 1143cdbf76 AgentHost - tweak loading when switching sessions (#323991)
Agents - more tweaks to the loading indicator
2026-07-02 08:18:32 +00:00
Bhavya UandCopilot a6f8e84822 Enable cache-break hint by default (#323959)
Remove the experimental chat.cacheBreakHint.enabled setting and its gate so
the model/options picker cache-break hint shows by default (still respecting
dismissal and cache-warm state).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-01 20:31:17 -07:00
Joaquín Ruales 0597c11310 Clean up ExPs (#323979) 2026-07-02 03:06:05 +00:00
Dmitriy Vasyura 107c2536e1 Remove tasks and problems tools from Agents window (#323978) 2026-07-02 02:59:25 +00:00
Dmitriy Vasyura ed577eeefb Handle opened and unsaved documents as attachments for Agent Host/Copilot CLI (#321591) 2026-07-02 02:40:03 +00:00
Sandeep SomavarapuandCopilot 9d557c6230 agentHost: chat-address the operational agent methods (collapse default/peer branches) (#323967)
* Refactor agent chat operations to resolve chats uniformly

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

* Refactor chat ops to use concrete chat URIs

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

* agentHost: tolerate a session URI at the chat-context chokepoint (fix CI)

The chat-addressing refactor removed the agents' tolerance for addressing the
default chat by its session URI (the AHP convention: default chat URI == session
URI). This broke integration tests that address the default chat by the session
URI (Malformed AHP chat URI) and restore via the mock agent (0 restored turns).

- Claude/Copilot `_getChatContext`: accept either a chat channel URI or a bare
  session URI, normalizing to the default-chat URI in the single resolution
  chokepoint (not re-derived per operational method). Codex already tolerant.
- MockAgent.getSessionMessages: normalize a default-chat channel URI back to the
  session URI, mirroring the real agents.

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

* agentHost: remove the dead onDidEndChat membership channel

onDidEndChat was declared by Claude and Copilot but never fired: a completed
subagent chat stays live and is removed only on session teardown (via a direct
removeChat), so subagent_completed intentionally has no end event. Remove the
unused channel end-to-end — the agents' emitters, the optional
IAgent.onDidEndChat member, the orchestrator subscription + _onChatEnded handler,
and the synthetic test. onDidSpawnChat (which is fired) remains as a spawn-only
membership channel.

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

* agentHost: rename IResolvedAgentChat.session to chatSession

Address CCR feedback: `session` overwhelmingly means the owning session URI in
this codebase, so `IResolvedAgentChat.session` (the resolved chat session
instance) was easy to misread. Rename to `chatSession` and update the two call
sites in claudeAgent.ts / copilotAgent.ts.

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 01:49:08 +00:00
Sandeep SomavarapuandCopilot e63efae792 sessions: quick chats (workspace-less sessions) in the Agents window (#323972)
* sessions: quick chats — workspace-less single-chat sessions

Adds quick chats to the Agents window: lightweight chats not scoped to a
workspace, backed by an agent-host session. The host infers workspace-less
from an absent workingDirectory (forks excluded) and assigns a stable scratch
dir; the workspaceless tag rides the generic _meta bag. Quick chats are
single-chat, use the normal session presentation (Done hidden), render in an
always-visible in-list "Chats" section, and persist across reloads.

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

* sessions: New from a quick chat opens another quick chat (Round 23)

The primary "New" action gated quick-chat routing on `isCreated &&
isQuickChat`, but a quick-chat draft is Untitled (isCreated=false), so it
fell through to the workspace composer seeded with a throwaway scratch dir
(no session-type picker, "No models available").

Route on `isQuickChat` alone so a quick chat — draft or committed — opens
another quick chat mirroring its harness. Extract the routing into a pure,
side-effect-free `openNewChatOrQuickChat` helper so it is unit-testable
(chat.contribution.ts is not test-importable). Supersedes Round 14(2) and
updates Round 22(3); the Round 14(2) discard branch and Round 17 picker
re-parent are kept as internal defense.

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

* sessions: quick-chat list & layout polish (Round 22 items 1-2)

- Suppress the redundant per-row chat icon when a quick chat is rendered
  under the always-visible "Chats" section (the section header already
  carries a chat icon); keep it in Pinned/custom/date groups where the
  chat identity is useful.
- Disable the "Toggle Side Panel" command for quick chats via
  precondition IsQuickChatSessionContext.negate(), since a quick chat has
  no side pane (the empty aux bar is hidden and the chat is full-width).

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

* agentHost: persist empty peer-chat catalog sentinel to avoid re-running legacy migration

When a session has no legacy peer chats, write an empty catalog so
_readPersistedPeerChatCatalog returns [] on subsequent restores and
_migrateLegacyPeerChats never re-runs.

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

* sessions: Cmd+N always creates a new session; New Quick Chat gets Cmd+K Cmd+N (Round 24)

Per user feedback, Cmd+N must always open a NEW SESSION — never a quick
chat. Drop the context-aware quick-chat routing from
NewChatInSessionsWindowAction (rename its title "New Chat" -> "New Session",
keep the id) so it unconditionally calls openNewSession from the active
session; the helper is renamed openNewChatOrQuickChat -> openNewSessionFromActive.

Quick chats are created only via the Chats-section "+" (NewQuickChatAction),
which now has a default Cmd+K Cmd+N chord. The peer-chat "+" (Cmd+T) is
unaffected. Supersedes the Round 22(3)/23 mirror routing; the Round 14(2)
discard branch and Round 17 picker re-parent are untouched.

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

* sessions: Cmd+N never inherits a quick chat's folder into the workspace composer (Round 25)

New from a quick chat must always land on the clean New Session composer with
a visible session-type picker. Gate openNewSessionFromActive's folder
inheritance on isQuickChat so a quick chat never carries a (possibly leaked
scratch) workspace URI into openNewSession.

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

* sessions: re-seed workspace draft when composer swaps out of quick-chat mode (Round 25b)

Cmd+N from a quick chat reuses the new-session composer and only
_activate(undefined), leaving it session-less. The session-type picker hides
itself when it has no folder types (no active session), so no picker showed.
Re-run the constructor's workspace-draft seed from an autorun when the composer
transitions out of quick-chat mode with no active session, matching a freshly
opened new-session composer (folder + visible picker).

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

* sessions: quick-chat untitled title falls back to "New Chat" via shared helper (Round 26)

An untitled quick chat's titlebar showed "New Session" because the empty-title
fallback was hardcoded and not quick-chat aware. Add getUntitledSessionTitle(isQuickChat)
to the common layer and route all 5 fallback sites (titlebar, session header x2,
list hover, sessions picker) through it.

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

* sessions: track isQuickChat in titlebar re-render autorun (Round 27)

The SessionsTitleBarWidget re-render autorun read the active session's
title and workspace but not isQuickChat, which _render() consumes for the
untitled title fallback. Track it as a reactive dependency for
forward-safety and consistency with other reactive render sites.

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

* agentHost: move workspace-less marker ownership to the AH service

Each agent used to persist and re-emit its own workspace-less (quick chat)
marker (copilot.workspaceless / claude.workspaceless) in the shared session
database, and agents that persist nothing (Codex) lost the marker on restart.

Make the AH service the single owner: AgentService persists a single
agentHost.workspaceless key at create/materialize (from the value it already
infers in _buildInitialSummary) and overlays _meta.workspaceless onto every
agent's summary in listSessions. Agents no longer write or namespace the
marker; Copilot reads the shared key for its resume system prompt, and the
now-dead workspace-less plumbing is removed from the Claude session. This
fixes restored quick chats for every agent (including Codex) with no
per-agent code.

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

* sessions/agentHost: address review feedback (naming + inline)

- Rename the workspace-less launch-plan flag from isQuickChat to
  workspaceless in CopilotSessionLaunchPlan and IAgentHostPromptContext (and
  the disposeSession local) so the flag matches the workspaceless marker it
  flows from throughout the AH layer. Feature-descriptive names
  (COPILOT_AGENT_HOST_QUICK_CHAT_INSTRUCTIONS, _quickChatScratchDir) are kept.
- Inline openNewSessionFromActive back into NewChatInSessionsWindowAction.run
  and remove the single-caller seam module + its test.

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

* agentHost: make the AH service the sole owner of the workspaceless marker

Following the earlier ownership move, the agents still read + re-emitted
_meta.workspaceless in their metadata projections, which was redundant on the
listSessions path (AgentService overlays it centrally) and only load-bearing
on the single-session restore path.

Centralize the restore overlay in AgentService.restoreSession (reads
agentHost.workspaceless in its existing batch metadata read and merges it into
the restored summary _meta), then drop the per-agent re-emit: remove it from
the Claude metadata store entirely (Claude has no runtime need) and from the
Copilot listSessions/getSessionMetadata projections. Copilot keeps reading the
AH key for its resume system prompt and scratch-dir cleanup. Codex is now
covered centrally with no Codex code.

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

* sessions: inline openQuickChatAndFocus into NewQuickChatAction

Single-caller helper folded into the action's run().

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

* sessions: make ISessionsProvider.createQuickChat mandatory

Replace the optional createQuickChat with a mandatory method that throws when
the provider does not support quick chats; callers now gate solely on the
supportsQuickChats capability instead of probing for the method. Workspace-bound
providers (Copilot chat, local chat) get an explicit throwing implementation.

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

* agentHost: use "workspace-less chat" terminology instead of "quick chat"

Rename the agent-host-internal quick-chat identifiers, prompt tags, and prose to
workspace-less: COPILOT_AGENT_HOST_QUICK_CHAT_INSTRUCTIONS ->
COPILOT_AGENT_HOST_WORKSPACELESS_INSTRUCTIONS, the <quick_chat> system-message
tag -> <workspaceless_chat>, and the scratch-dir helpers
(_quickChatScratchDir/_ensure*/_cleanup*/_withQuickChatScratch). The workbench
UI term "Quick Chat" is kept only where the agent host documents that mapping.

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

* sessions: address Copilot Code Review feedback on quick chats

- sessionsList: select the row chat icon from isQuickChatSession(), not from
  workspace === undefined, so a workspace session with a transiently-undefined
  workspace no longer briefly shows the chat icon.
- sessionContextKeys: correct the isQuickChat comment to reflect that the key
  is sourced from the isQuickChat tag, never inferred from workspace absence.
- Agents window accessibility help: document the New Quick Chat command
  (Cmd/Ctrl+K Cmd/Ctrl+N) and the Chats section plus button, and note that the
  workspace picker does not apply and Toggle Side Panel is disabled for quick chats.

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 00:38:15 +00:00
Connor PeetandCopilot 17c6cd4836 Agent-host MCP authentication + accurate/persisted MCP auth state (#323968)
* wip on mcp auth through AH

* Preserve live MCP server state across customization re-syncs

The Agents window showed a connected GitHub MCP server flipping back to
'Starting' when navigating away from and back to a session. A client
re-subscribe re-published the session's customizations, and the
SessionCustomizationsChanged full-replace reset each MCP entry's state to
the 'Starting' default baked into makeMcpServerCustomization.

- Skip no-op customization re-syncs in SessionPluginController.sync so an
  identical re-publish (e.g. navigating back) does no work.
- SessionPluginController now overlays live MCP runtime state/channel onto
  every published customization via _projectForPublish, so a genuine
  single-customization change no longer resets otherwise-unchanged MCP
  servers. The overlay is driven by an ISettableObservable kept up to date
  by the session from McpCustomizationController.
- McpCustomizationController._live is now an observable and exposes
  runtimeStates as a derived; mutations are batched in transactions.

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

* Persist agent-host MCP auth and improve auth-required prompts

- Key remembered MCP auth on a stable id (session authority + server name +
  resource URL) instead of the unstable customization id, so grants survive
  reloads and don't require re-auth.
- Record agent-host metadata (authority + host label) on allowed MCP servers
  and surface agent-host servers in their own section of the Manage Trusted
  MCP Servers picker instead of filtering them out.
- Make the auth-required chat prompt reactive: servers is now an observable so
  servers whose auth requirement surfaces later join the existing prompt, and
  the part marks itself used once hidden so later requirements re-prompt.
- Show an 'Authenticating <server>...' progress state while each server auths.
- Drop the never-serialized mcpAuthenticationRequired part from the serialized
  response-part unions.
- Add unit tests for the stable-id helper, agentHost metadata persistence, and
  query-service exposure.

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

* Address CI failure and Copilot review on MCP auth prompt

- Don't emit an empty mcpAuthenticationRequired progress part (was adding a
  stray part and breaking AgentHostChatContribution tool-progress tests).
- Guard the async auth filter with a run id so out-of-order completions can't
  overwrite a newer server list.
- Group agent-host servers in the Manage Trusted MCP Servers picker by stable
  authority (sorted by label) instead of label, which could collide.
- Scope the authenticate link to the #authenticate target and give it button
  semantics (role=button, cleared href).

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 00:26:28 +00:00
Connor Peet fc47281226 Merge pull request #323953 from microsoft/conno/log-client-tool-completion
Add client tool completion routing logs
2026-07-01 16:58:08 -07:00
Justin Chen f170fd1f23 GA vision in vs code (#323965)
* GA vision in vs code

* address settings changes
2026-07-01 23:49:35 +00:00
Sandeep SomavarapuandCopilot 8f1b02ba77 sessions: support read-only chats and surface subagents as read-only tabs (#323960)
Adds ChatInteractivity (Full/ReadOnly/Hidden) to IChat and hides the composer
for non-interactive chats (gated via chatIsReadonly context key). Surfaces agent
host subagent (tool-origin) chats as read-only peer tabs with a lock icon,
persisted across restart. Adds an inline "Open Subagent" pill in the transcript
and a "Subagents" dropdown above the chat input to reveal them.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-01 23:48:37 +00:00
Sandeep SomavarapuandCopilot b7b8a8049d agentHost: resolve per-chat effective working directory in session projection (#323950)
* agentHost: remove Claude dead legacy migration + drop redundant session param

PART 1: remove the unreachable claude.chats legacy peer-chat migration
(listLegacyChats, _readPersistedChats, _META_CHATS and the two dead
fallback call sites). Copilot's copilot.chats migration and the
orchestrator's generic migration are unchanged.

PART 2A: drop the redundant session parameter from IAgentChats.createChat
and fork. Each agent derives the parent session from the chat URI.

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

* agentHost: demote default chat to a uniform chat-map entry

Restructure the shared AgentSessionEntry so a session's default (main)
chat lives in the SAME per-session chat map as its peers, keyed by its
default-chat URI. Send/abort/model/agent/history now resolve any chat
via one uniform getChat lookup with no default-vs-peer storage split.

- agentPeerChats.ts: single _chats map + _defaultChatKey; getChat is the
  uniform lookup; defaultChat/setDefaultChat/clearDefaultChat replace the
  separate default-session slot; peer accessors read the same map.
- Claude/Copilot seed the default chat into the map (setDefaultChat) and
  read it via defaultChat; _findChat is a single uniform lookup.
- Two lifecycle guards kept at the session boundary: createSession seeds
  the default entry; disposeChat/createChat refuse the default chat.
- Codex (single-chat) unchanged; still resolves through the session URI.

No protocol/state changes; behavior identical (Agent* suites green).

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

* agentHost: resolve per-chat effective working directory in session projection

Generalize the mergeSessionWithDefaultChat projection so a chat's resolved
session-context view (working directory, active clients, config,
customizations/MCP scope, …) applies to ALL chats, not just the default one.

The projection already spreads the full SessionState onto every chat, but it
ignored ChatState.workingDirectory — a per-chat override the protocol allows so
a subordinate/peer chat can run in its own git worktree. Operational consumers
(changeset/commit/discard/git/PR/sync services + agentService) read the effective
cwd via getSessionState(...)?.workingDirectory, so a chat with its own worktree
incorrectly reported the session default. Layer chat.workingDirectory over the
session default in the projection so no code path has to walk back to the session.

Pure orchestrator-side projection: no wire-protocol, IAgent, or persisted-shape
change. Docs generalized from "default chat" to per-chat effective context.

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

* agentHost: route MockAgent createChat/fork through the resolved chat URI

Address CCR feedback: createChat/fork resolved the session via
_resolveChatTarget but passed the original chat argument, so a default-chat
call (session URI) would use the session URI instead of the resolved
default-chat channel URI. Destructure and pass the resolved { session, chat }
to match the other chat-addressed methods in the mock.

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-01 22:47:27 +00:00
dileepyavanandCopilot Autofix powered by AI c63b0bab6b Add Responses API cache control markers (#321850)
* Add Responses API cache control markers

* Refactoring code

* Potential fix for pull request finding

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

* Gate Responses API cache breakpoints by model support

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-01 22:30:36 +00:00
Anthony Kim d892b5773d Agent Host: Use SDK shell exit metadata for command decorations (#323922)
* use sdk shell_exit for command deocrations

* address copilot feedback

* comment
2026-07-01 15:18:00 -07:00
Paul 90b81ef265 Fix issues with chat perf pipeline (#323917) 2026-07-01 22:10:25 +00:00
Osvaldo Ortega 93e8c6cef9 Task API auth fix (#323951) 2026-07-01 22:09:32 +00:00
Connor PeetandCopilot df591a6ac2 Add client tool completion routing logs
Log the server-side forwarding path for client tool completions so reports can distinguish missing agents, missing peer chats, and subagent chat routing issues.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-01 14:56:52 -07:00
Ladislau Szomoru 34e2a17713 AgentHost - fix opening files when using checkpoint refs (#323932) 2026-07-01 21:50:39 +00:00
d70651f223 Agents mobile: UX improvements to open workspace action (#322812)
* sessions: add explicit "Open this folder" action to the mobile workspace picker

Tapping a folder in the mobile workspace picker drills into that folder, which re-renders the search results and removes the visible checked state for the selected folder. That made it unclear that Done would select the browsed folder.

Add a confirm-close sentinel to the reusable mobile picker sheet so stay-open pickers can explicitly confirm a row. Use it from the workspace picker to prepend an "Open this folder" row for the currently browsed folder, while preserving child-folder drill-down and Done confirmation.

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

* sessions: redesign mobile workspace picker "Select folder" as a single pinned action

Replace the synthetic checked "Open {folder}" row (which produced two
checkmarks and a Done/Open redundancy) with one tinted-accent, pinned
"Select {folder}" primary action above the folder list. Folder rows now
carry a chevron to signal drill-down, recents show only at the root, and
the header button is a plain Cancel.

Adds reusable primitives to the mobile picker sheet:
- `IMobilePickerSheetItem.navigates` renders a trailing chevron and is
  excluded from the radio-toggle.
- a pinned primary action driven declaratively by the search source via
  `IMobilePickerSheetSearchSource.getPrimaryAction(query)`.
- `doneLabel` to override the dismiss button label.

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

* Review comments

---------

Co-authored-by: osortega <osortega@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-01 14:28:08 -07:00
Don JayamanneandCopilot Autofix powered by AI acf39e86ff feat: enhance chat context usage details with reactive rendering and equality checks (#323838)
* feat: enhance chat context usage details with reactive rendering and equality checks

* 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>

* Potential fix for pull request finding

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

* feat: implement reactive rendering for chat context usage data updates

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-01 21:23:56 +00:00
dependabot[bot] 7e7f9505b9 build(deps): bump tmp from 0.2.6 to 0.2.7 in /test/automation (#323938)
Bumps [tmp](https://github.com/raszi/node-tmp) from 0.2.6 to 0.2.7.
- [Changelog](https://github.com/raszi/node-tmp/blob/master/CHANGELOG.md)
- [Commits](https://github.com/raszi/node-tmp/compare/v0.2.6...v0.2.7)

---
updated-dependencies:
- dependency-name: tmp
  dependency-version: 0.2.7
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-01 21:13:46 +00:00
Josh SpicerandCopilot 5a270e6dbd policy: resolve managed settings per-key across delivery channels (#323780)
* policy: resolve managed settings per-key across delivery channels

Managed settings previously used a single authoritative source: the first
non-empty delivery channel (native MDM > server > file) won wholesale and the
others were ignored entirely. Switch to per-key precedence: the same order is
honored, but resolved key-by-key. A key locked by a higher-precedence channel
still cannot be overwritten, while keys a higher channel leaves unset are now
filled in by a lower channel.

Centralize the resolution in a new pickManagedSettings() (replacing
selectManagedSettings) that returns the merged bag, per-key provenance, and the
active sources, so policy evaluation and the Policy Diagnostics report share one
implementation. Build the merged bag with Object.fromEntries so an untrusted
__proto__ key cannot corrupt its prototype chain.

Rework the Policy Diagnostics report to show every contributing source, a per-key
Resolution table (effective value, winning source, and struck-through overrides),
and per-key policy attribution.

Add unit coverage for the per-key merge (provenance, fill-down, falsy values,
ordering, prototype-pollution guard) plus an end-to-end test proving two keys can
win from two different channels and both reach policy evaluation.

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

* policy: iterate managed-settings bags with Object.keys over own props

Address PR feedback: switch pickManagedSettings from `for...in` to a guarded
`Object.keys` loop so only own enumerable properties are visited (managed-settings
bags are untrusted input) and absent channels are skipped explicitly.

Note: `for...in` over an undefined bag was already a no-op (never threw), so this is
a robustness/clarity improvement rather than a crash fix.

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

* policy: tidy pickManagedSettings unit suite

Drop two redundant cases (distinct-keys and standalone activeSources ordering,
both already covered by the headline and empty/absent tests) and fold the
non-contributing-middle-channel ordering check into the empty/absent snapshot.
Verified against the live node unit runner (all green).

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-01 13:55:15 -07:00