Commit Graph

22155 Commits

Author SHA1 Message Date
copilot-swe-agent[bot] 751fd19566 Merge remote-tracking branch 'origin/main' into vikram/cache_timeout_fix
# Conflicts:
#	extensions/copilot/src/platform/configuration/common/configurationService.ts

Co-authored-by: vikramnitin9 <13903468+vikramnitin9@users.noreply.github.com>
2026-05-15 22:38:49 +00:00
Bhavya U 0bd2387d0e Anthropic 1h cache TTL: expand model list, add message-breakpoint sub-toggle (#316679)
* Expand extended cache TTL model list + add message-breakpoint sub-toggle

Two related changes to Anthropic Messages API prompt caching:

1. Expand modelSupportsExtendedCacheTtl beyond just the 1M context
   variants. Per Anthropic docs, the 1h cache TTL is available on all
   active models; this widens our opt-in list to Claude Opus 4.5/4.6/4.7
   and Sonnet 4.5/4.6 (all variants, not just -1m).

2. Add a new experiment-based setting
   chat.anthropic.promptCaching.extendedTtlMessages as a strict
   sub-toggle of the existing extendedTtl setting. When both are on, the
   rolling message-level breakpoints (last cacheable user / tool-result
   blocks set by addMessagesApiCacheControl) also use the 1h TTL
   instead of the default 5m. Nested rather than orthogonal because
   Anthropic requires longer-TTL breakpoints to appear before shorter
   ones in the tools->system->messages prefix order.

Tests: 69 passed. Added a suite for isExtendedCacheTtlMessagesEnabled
(parent on/off x sub on/off matrix + inherited model/location/subagent
gates) and two tests verifying addMessagesApiCacheControl propagates
the new cacheTtl argument.

* Slim down extended cache TTL tests

- Trim isExtendedCacheTtlEnabled model-list test to just verify the
  delegation (full boundaries are covered by modelSupportsExtendedCacheTtl).
- Remove redundant 'inherits gates from parent' test in
  isExtendedCacheTtlMessagesEnabled suite — the parent×sub matrix plus
  the parent's own gate tests already cover this.
- Merge the two addMessagesApiCacheControl ttl tests into one
  parameterized assertion.

* Update stale comment about message breakpoint TTL

The comment claimed message breakpoints 'always use the default 5m TTL',
but that's no longer true when the new extendedTtlMessages sub-toggle is on.

* Refactor extended cache TTL: pass parentEnabled, drop misleading coercions

- isExtendedCacheTtlMessagesEnabled now takes parentEnabled: boolean
  instead of re-running the parent gate. Call site passes the resolved
  useExtendedCacheTtl directly, eliminating a duplicate experiment-service
  lookup per request. Makes the 'sub-toggle of' relationship literal in
  the signature.
- Drop the !! coercion on getExperimentBasedConfig<boolean> returns —
  the generic guarantees T, so the coercion was misleading defensive
  noise.
- Narrow cacheTtl param from '5m' | '1h' to just '1h' on both
  addToolsAndSystemCacheControl and addMessagesApiCacheControl. Per
  Anthropic docs, { type: 'ephemeral' } already defaults to 5m, so '5m'
  is never actually emitted on the wire and call sites never passed it.
- Stronger composition test for isExtendedCacheTtlEnabled — replaces
  four single-axis tests with one table-driven matrix that exercises
  all four gates simultaneously, catching short-circuit refactors.
- Table-driven 2x2 matrix for isExtendedCacheTtlMessagesEnabled.
- Trim user-facing extendedTtlMessages setting description; team-only
  rationale (rolling breakpoints, 2x write premium) lives in the JSDoc.
- Update stale comment claiming message breakpoints always use 5m.

* Remove outdated comments about extended cache TTL models
2026-05-15 14:57:03 -07:00
Vijay Upadya 0f573fc427 Local sql improvements (#316694)
* Local sql updates

* minor update

* test update

* eslint changes

* feedback updates
2026-05-15 14:03:27 -07:00
Vritant Bhardwaj 313f910013 Merge pull request #316534 from microsoft/dev/vritant24/copilotUtilityOverride
Add support for utility model overrides in chat
2026-05-15 13:20:08 -07:00
Matt Bierner 35b08e377e Merge pull request #316332 from microsoft/dev/mjbvz/build-in-mermaid
Move bierner.markdown-mermaid into core
2026-05-15 13:12:00 -07:00
Vritant Bhardwaj af6813c49f Merge branch 'main' into dev/vritant24/copilotUtilityOverride 2026-05-15 12:08:02 -07:00
guomaggie 7b21f805e1 Return final answer text when snippet hydration errors (#316094)
update search subagent hydration
2026-05-15 11:35:07 -07:00
Bhavya U 576f58a9f9 Gate replayed thinking blocks on same-model match for all rounds (#316664)
Thinking blocks are signed/encrypted by the producing model and tied to its API surface. The previous gate short-circuited the same-model check for the current turn ('!isHistorical || ...'), so a round produced by a different model in the same turn — e.g. a subagent handoff or a mid-turn model switch — would still have its thinking replayed through the endpoint's model. Anthropic Messages rejects this with a signature validation error; Responses treats it as garbage reasoning state.

Make sameModelAsEndpoint a hard precondition for including thinking, regardless of whether the round is historical, matching the existing convention used a few lines below for phase.

Related: https://github.com/microsoft/vscode/issues/316536
2026-05-15 18:26:34 +00:00
Matt Bierner d55d8a6f9f Merge pull request #316659 from microsoft/dev/mjbvz/yelling-mockingbird
Aligning more markdown wording and UI
2026-05-15 11:12:48 -07:00
Matt Bierner 8bc23c9116 Aligning more markdown wording and UI
- Use `frontmatter` (one word)

- Align  `Show source` icon and text with the reopen with

- Make the `Open preview` in explorer use `reopen with` instead so you can nicely toggle the opened preview
2026-05-15 10:53:34 -07:00
Matt Bierner 1ba8055687 Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-15 10:27:36 -07:00
Matt Bierner 027bd2f081 Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-15 10:26:48 -07:00
Matt Bierner 360101c748 Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-15 10:26:26 -07:00
Vritant Bhardwaj c08d36bccf Merge branch 'main' into dev/vritant24/copilotUtilityOverride 2026-05-15 10:25:56 -07:00
Matt Bierner 91f6127cc9 Merge pull request #316142 from microsoft/dev/mjbvz/important-anglerfish
Gate external ingest on policy on token
2026-05-15 10:25:46 -07:00
Vritant Bhardwaj e54e2a7382 Merge branch 'main' into dev/vritant24/copilotUtilityOverride 2026-05-15 10:04:36 -07:00
Vritant Bhardwaj 51583bd944 Fix BG Todo Agent calls
Removed the 'stream' option from requestOptions.
2026-05-15 09:58:12 -07:00
Vikram Nitin f805d63def Merge pull request #316181 from vikramnitin9/vikram/pwsh_fix
[Bug Fix] Execution Subagent: Compare shell type with "pwsh" in addition to "powershell"
2026-05-15 12:52:51 -04:00
vritant24 f5a3b096cd Enhance buildUtilityAliasModelInfo to support Copilot endpoints and synthesize for non-Copilot endpoints with shared model IDs 2026-05-15 09:19:13 -07:00
vritant24 e82525f10d Enhance utility alias model info to include requiresAuthorization for BYOK overrides 2026-05-15 08:43:57 -07:00
Vritant Bhardwaj 85a30f0bce Merge branch 'main' into dev/vritant24/copilotUtilityOverride 2026-05-15 08:25:09 -07:00
vritant24 64aa1701c0 Add BYOK test coverage for utility model override resolution
The override resolver's non-Copilot vendor branch (which goes through
vscode.lm.selectChatModels) was not exercised by the existing tests.
Add four cases stubbing lm.selectChatModels with sinon: success returns
an ExtensionContributedChatEndpoint; zero matches, multiple matches
(ambiguous), and rejection all fall back to the default copilot-utility.

Addresses PRRT_kwDOAn8RLM6CZMCp.
2026-05-15 08:24:29 -07:00
vritant24 ad5409f8e8 address PR comments 2026-05-15 07:42:56 -07:00
vritant24 e2040ddcf2 remove extraneous comments 2026-05-15 06:52:51 -07:00
vritant24 a094acf418 address comments 2026-05-15 06:43:01 -07:00
dileepyavan 7e3c7e48d8 Use GPT-5.4 large prompt as default (#316567)
gpt5.4 prompt updates
2026-05-15 10:05:31 +02:00
vritant24 9a8d81a3cb copilot: harden utility-override validation and cache invalidation
Validate the override value at runtime: getNonExtensionConfig<string> is a TS cast only, so a user putting a non-string in settings.json (e.g. 42) would crash getChatEndpoint with raw.indexOf is not a function. Treat any non-string value as 'no override' and ignore.

Subscribe to vscode.lm.onDidChangeChatModels and forward it as a model refresh. The copilot model fetcher's own onDidModelsRefresh covers the copilot vendor; this catches the BYOK case where the underlying provider can refresh or remove models out-of-band.

Add a regression test for the non-string override path.
2026-05-14 22:47:54 -07:00
vritant24 1446a07340 copilot: do not publish synthesized BYOK utility aliases
isUserSelectable: false does not stop an extension from resolving `vscode.lm.selectChatModels({ vendor: 'copilot', id: 'copilot-utility[-small]' })` and using the returned LanguageModelChat to call sendRequest. When the alias resolved to a BYOK override, that proxied requests to the user's configured BYOK endpoint without going through that provider's authorization flow.

Skip publishing the alias entry under the copilot vendor when the resolved endpoint is not produced by this provider. The internal _utilityAliasEndpoints map is still populated, and copilot's own internal callers continue to honor the override via IEndpointProvider.getChatEndpoint(family) — they don't depend on the alias being published through the public LM API surface.
2026-05-14 22:47:39 -07:00
Don Jayamanne d1e403ebbf Add archived state management and worktree sharing for chat sessions (#316561)
* Add archived state management and worktree sharing for chat sessions

- Introduced `archived` property in `ChatSessionMetadataFile` to track archived sessions.
- Updated `IChatSessionMetadataStore` interface to include methods for setting and getting archived state.
- Implemented logic in `ChatSessionMetadataStore` and `MockChatSessionMetadataStore` to handle archived sessions.
- Added `getBlockingSiblingSessionsForFolder` utility to identify sessions that share worktrees.
- Modified CLI chat session commands to respect archived state during session deletion and worktree cleanup.
- Updated tests to cover new functionality and ensure proper behavior of session management.

* Add worktree sharing edge-case unit tests

Co-authored-by: DonJayamanne <1948812+DonJayamanne@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-05-14 22:21:16 -07:00
vritant24 438598bc8e copilot: fix utility alias publishing for BYOK overrides
Extract the alias-info builder into a pure helper and pass an explicit isCopilotProviderEndpoint flag, so a BYOK model whose id collides with a copilot model id (e.g. 'gpt-4o') is no longer misidentified as copilot and cloned with the wrong metadata.

Subtract baseCount + BaseTokensPerCompletion from the synthesized maxInputTokens so the reported context window matches the convention used by the regular model entries (instead of overstating it).

Add unit tests for the helper covering the clone, BYOK id-collision, and missing-base cases.
2026-05-14 22:10:49 -07:00
vritant24 6b05c5af75 copilot: invalidate cached semantic search endpoint on model refresh
SemanticSearchTextSearchProvider caches the copilot-utility-small endpoint after the first use. Without subscribing to IEndpointProvider.onDidModelsRefresh, changing chat.utilitySmallModel later did not affect the search flow until the provider was recreated. Make the provider Disposable, subscribe to the refresh event, and dispose the provider alongside its registration.
2026-05-14 22:10:35 -07:00
vritant24 e746f9007e copilot: strict utility-model override resolution
Reject ambiguous overrides (more than one matching model) instead of silently picking the first result, which could route requests to the wrong configured endpoint.

Demote per-resolution info logs to trace; utility endpoints are used by many background flows and unguarded info logs are noisy when an override is configured.

Restrict the chat.utilityModelOverride telemetry event to successful applications only, and drop the vendor/modelId fields. Those values can be user-provided for BYOK/custom endpoint providers and should not be reported. Clear the per-family fingerprint when the relevant setting changes so a new value emits once.
2026-05-14 22:10:25 -07:00
Vijay Upadya 0b181f5821 Chronicle: fold sub-agent sessions into parent timeline and address session overwrite issue (#316542)
* Chronicle: fold sub-agent sessions into parent timeline and fix session overwrite

* feedback update
2026-05-14 21:45:13 -07:00
Bhavya U c2e88be2fd Enable chat.freezeCustomizationsIndex by default (#316466)
Flips the default for `chat.freezeCustomizationsIndex` from `false` to `true` so the customizations payload (`<instructions>`/`<skills>`/`<agents>`) is frozen at the first turn of a conversation and reused on subsequent turns, stabilizing the system-prompt prefix for cache reuse.
2026-05-14 21:23:01 -07:00
Paul b0334a16a0 Handle quota errors for claude CLI (#316310) 2026-05-14 21:18:40 -07:00
Paul 754406cdf9 Add quota reached message (#316519) 2026-05-14 18:42:13 -07:00
vritant24 5e271cce46 copilot: publish utility aliases for non-copilot override targets
Loosen `_registerUtilityAliasModels` so the copilot-utility / copilot-utility-small aliases are still published when the resolved endpoint belongs to a non-copilot vendor (e.g. a BYOK Anthropic / Gemini model selected via chat.utilityModel).

Previously, the alias was published only if `endpoint.model` matched
a model already in this providers `models` list — a copilot-vendor
model. Any consumer asking for `vscode.lm.selectChatModels({ vendor:
copilot, id: copilot-utility })` would then get nothing and the
override would be silently unreachable for that codepath.

The new behavior:

- copilot-vendor endpoint: clone the existing entry (preserving
  rich provider metadata like tooltip, pricing, requiresAuthorization,
  etc.).
- non-copilot endpoint: synthesize a minimal entry from the
  endpoint itself (name, family, version, max input/output tokens,
  supportsToolCalls, supportsVision). The alias is hidden from the
  picker (`isUserSelectable: false`); the missing rich fields are not
  user-visible. The vendor is `copilot` either way because this
  provider is registered under that vendor.

Add trace logs that distinguish the cloned vs synthesized branches so
the alias mapping is visible in logs.
2026-05-14 18:08:26 -07:00
vritant24 9e5312ba03 copilot: honor chat.utilityModel and chat.utilitySmallModel overrides
When the user has set chat.utilityModel / chat.utilitySmallModel, route the corresponding internal utility family through the configured model instead of the default CAPI selection.

The override is read in `_resolveUtilityFamily` and resolved by a new `_resolveUtilityOverride` helper:

- The setting value is encoded as `${vendor}/${id}` (matching the
  workbench storage format). It is parsed once and routed by vendor:
  - copilot vendor: looked up via `_modelFetcher.getAllChatModels()`.
    Going via `lm.selectChatModels({vendor: copilot, ...})` from
    inside this codepath would re-enter the language-model
    services per-vendor `_resolveLMSequencer` (which is held while
    the copilot LM provider is preparing its model list — this same
    resolution path runs as part of utility-alias publishing). That
    re-entrancy deadlocks the picker. The fast path through
    `_modelFetcher` avoids it.
  - other vendors: looked up via `lm.selectChatModels` and wrapped
    in `ExtensionContributedChatEndpoint` for actual request
    dispatch. Different vendors use different sequencer keys, so
    no deadlock.
- Any failure (malformed value, no match, lookup throws, fetch
  throws) silently falls back to the existing
  `CopilotUtility{Small,}ChatEndpoint.resolve()` path. Failures are
  logged at warn level so they show up in default logs without
  spamming.
- A constructor-side `onDidChangeConfiguration` subscription fires
  `_onDidModelsRefresh` when either setting changes so the alias
  endpoints are reresolved on the next request.

Also wires telemetry (`chat.utilityModelOverride`) for adoption and outcome tracking. The event is deduped per family via a fingerprint of `${raw}|${outcome}|${vendor}|${modelId}` so we emit at most once per genuine change to the setting or to which model it resolves to. Only successful applications (`applied-copilot` / `applied-extension`) include vendor + modelId; failure outcomes leave them blank.
2026-05-14 18:08:08 -07:00
Paul bf45fc4450 Await copilot CLI metadata persistence (#316507) 2026-05-14 15:24:16 -07:00
Osvaldo Ortega ce2ab59a8a Agents picker: include private repos in search results (#316495)
/search/repositories does not include private repos unless the query is scoped via user:/org: qualifiers. Append the authenticated user's login and their org memberships to the search query so private repos accessible to the permissive token surface in the agents repo picker.

Fixes #309659
2026-05-14 14:14:58 -07:00
Vritant Bhardwaj 4f8ce47c05 Merge branch 'main' into agents/rename-copilot-utility-models 2026-05-14 11:38:24 -07:00
Logan Ramos a1803b2a0c Fix UBB model details in Copilot CLI (#316452)
* Bump SDK

* fix cli tests and stuff

* Tests plz
2026-05-14 17:47:40 +00:00
vritant24 ef061ccb0f Rename copilot-fast/copilot-base to copilot-utility-small/copilot-utility
Introduces dedicated endpoint resolver classes (CopilotUtilitySmallChatEndpoint,
CopilotUtilityChatEndpoint) in place of the ModelAliasRegistry indirection, and
republishes the resolved utility endpoints under their new family ids
('copilot-utility-small', 'copilot-utility') as LanguageModelChatInformation
entries so that workbench callers using selectLanguageModels({ vendor: 'copilot',
id: 'copilot-utility-small' }) keep working.

- Renames the internal family identifiers everywhere they're consumed:
  callers, tests, and workbench code in src/vs/workbench/contrib/chat/.
- Drops src/platform/endpoint/common/modelAliasRegistry.ts.
- CopilotUtilitySmallChatEndpoint.resolve tries a small primary model and
  falls back to a second small model if the primary is unavailable.
- CopilotUtilityChatEndpoint.resolve returns the API-marked default base
  model (is_chat_fallback === true), preserving existing behavior.
- Updates _copilotBaseModel field and 'copilot-base' literal in
  ModelMetadataFetcher to _copilotUtilityModel / 'copilot-utility'.

No user-facing behavior change. The setting-driven 'disabled'/'default'/BYOK
selector support will be layered on top in a follow-up.

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

remove comment

remove code smell

remove more code smell
2026-05-14 10:37:23 -07:00
Aaron Munger 2cd5e1919d tool call events for AH and Claude CLI as well (#316291)
* tool call events for AH and Claude CLI as well

* consistent ownership

* share definitions

* comment

* Remove Agent Host telemetry changes (split to aamunger/ToolCallTelemetry-AH)
2026-05-14 10:33:32 -07:00
Paul 77c45b33cf Update in-chat message for credit limit (#315135) 2026-05-14 10:12:36 -07:00
Vijay Upadya 8dee56f8d1 BYOK: Custom Endpoint provider — Chat Completions, Responses, and Messages API support (#316189)
* Custom Endpoint: message API, responseAPI support and  apiType picker

* Feedback changes

* create new vendor customEndpoint

* update msg

* update desc
2026-05-14 09:57:59 +02:00
Dmitriy Vasyura 08244096a5 BYOK: Enable Manage Language Models commands without GitHub sign-in (#316202)
---------

Co-authored-by: Copilot <copilot@github.com>
2026-05-13 22:30:59 -07:00
Connor Peet 18d1e88096 Merge remote-tracking branch 'origin/main' into connor4312/ah-matrix 2026-05-13 20:28:21 -07:00
Matt Bierner 964d1fa6ff Adding UI for external ingest enablement 2026-05-13 18:17:41 -07:00
Paul 9c492c5546 Handle pool exhausted state for chat status dashboard and chat input notifications (#316304) 2026-05-14 00:05:38 +00:00