Commit Graph
394 Commits
Author SHA1 Message Date
Martin Aeschlimann 611c5dfed2 local harness: simplity checking for external resources (#331816)
* local harness: simplity checking for external resources

* fix test
2026-08-20 16:12:57 +00:00
Martin Aeschlimann 680caf21e4 warn when reading linked files (#331799)
* warn when reading symlinked files

* fix windows tests
2026-08-20 15:12:45 +00:00
Martin Check 09b07fe400 chat: avoid splitting surrogate pairs in read_file (#331005) 2026-08-16 07:59:52 +00:00
Bhavya U a5944fe94f Enable tool search for Claude Haiku 4.5 and Sonnet 5 (#328662)
Anthropic's tool search compatibility table lists Haiku 4.5 as supported,
but the capability gate denied all Haiku. Sonnet 5 and Mythos 5 were also
missing from the tool's model picker list.
2026-08-03 05:17:22 +00:00
Bhavya UandCopilot 9ccad27a28 Enable tool search for GPT models and add deferThreshold setting (#328136)
* Enable tool search for GPT models and add deferThreshold setting

- Uncomment GPT-5.4/5.5/5.6 support in agentHostModelSupportsToolSearch
- Add chat.agentHost.copilot.toolSearch.deferThreshold setting (default 1)
- Fix system instruction: generic 'use tool search' instead of backtick-quoted tool_search_tool name that doesn't exist in OpenAI Responses API
- Fix tool search description: generic 'deferred tools list' instead of extension-specific availableDeferredTools tag name
- Floor fractional threshold values to prevent runtime fallback to 30

* Address tool search review feedback

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-31 11:32:32 -07:00
Arthur Cnops eb699a8ed4 Voice: answer question carousels by voice (#327899) 2026-07-29 18:18:51 +00:00
Vijay Upadya 7d6473ca69 Compress large telemetry properties with gzip chunked columns (#327490)
* Compress large telemetry properties with gzip chunked columns

* feedback updates

* Fix continuous telemetry sender test for async best-effort send
2026-07-27 19:41:29 +00:00
Bhavya U a7fa33e78a Add Claude Opus 5 system prompt (#327410)
* Add Claude Opus 5 system prompt

Adds a minimal Opus 5 prompt behind `chat.claudeOpus5Prompt.enabled`,
following Anthropic's guidance for the Claude 5 generation: describe the
environment as facts rather than rules, put the behavioral weight into
scope and correction guidance, and drop the rule lists the model now
handles with its own judgement. Off by default, falling back to the
Claude 4.6 Opus prompt.

Also:
- Remove the Opus 4.8 and Sonnet 5 prompts and their settings. Both
  models now use the Claude 4.6 prompts.
- Add comment-etiquette guidance to the shared optimized reminder, so it
  reaches every Claude 4.6+ family rather than a single prompt.
- Enable tool search for claude-opus-5.

* Reword Opus 5 prompt to remove borrowed phrasing

The prompt had picked up wording from a reference system prompt during
drafting. Rewrites every affected passage in original wording, keeping
the guidance intact. Verified no shared word sequence of five or more
remains between the branch's added lines and that reference.
2026-07-24 23:09:33 +00:00
Paul 4224780376 Update edit permissions (#327199) 2026-07-23 21:00:49 +00:00
c6b3beee5e Add tool search to Copilot agent host (#326213)
* Add tool search to Copilot agent host

* Address review: alias-aware tool-search gating, drop transient candidates, cover prompt branch

- Compute the tool-search capability decision from the family-aliased model in
  both the launcher and CopilotAgentSession so an aliased preview model is no
  longer rejected and the two stay in agreement.
- Strip the transient tool-search candidate corpus from the completed tool
  call's _meta so repeated searches don't bloat synchronized session state or
  persist across reconnects.
- Add active/inactive + composition tests for the tool-search prompt line at
  both the unit and prompt-registry layers, plus a model-family alias
  regression test for tool-search gating.

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

* Remove obsolete tool-search start barrier

* Address tool-search review feedback

* Use the extension's existing tool-embedding cache for Agent Host search

* Address review: keep server tools eager, harden tool-search candidate corpus

- Force server-provided SDK tools to defer:'never' so they stay eager and are
  not deferred behind tool_search.
- Default missing candidate descriptions to '' when building the tool-search
  corpus, so the all-or-nothing metadata reader never drops a valid corpus.
- Drop the unused inputSchema field from the tool-search candidate corpus
  (name + description are all the embeddings ranker consumes).
- Use the client-facing tool name in the custom-tool auto-approve membership
  check so a deferred tool_search runtime name resolves correctly.
- Remove a redundant conjunct in _clientToolName already implied by
  _isToolSearchActive().

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

* Temporarily disable GPT tool search

---------

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-07-23 18:06:31 +00:00
Logan Ramos bc38398417 Make sub agents implemented as tools render as subagents (#326867) 2026-07-21 19:40:57 +00:00
Dirk Baeumer c08cf69cd3 Update default in code. 2026-07-20 20:40:50 +02:00
Dirk Bäumer 9d65f09189 Add defaultMaxResults parameter to FindTextInFilesTool options (#324733) 2026-07-07 10:57:29 +00:00
Dirk Bäumer 36984a011c Replace hard coded values with dynamic methods (#324709)
Replace hard coded values
2026-07-07 10:13:09 +00:00
Dirk Bäumer 2d0877ddee Make grep the new default search tool output format (#324186) 2026-07-03 10:06:31 +00:00
Dirk Bäumer 132a773459 Enhance telemetry for findTextInFilesTool with requested max results (#323892)
* Enhance telemetry for findTextInFilesTool with requested max results

* Fix telemetry maxResults parameter handling in FindTextInFilesTool

* Fix GDPR comment
2026-07-01 16:44:27 +00:00
Dirk Bäumer 2a8040d14f Enhance telemetry for FindTextInFilesTool (#323737)
Enhance telemetry for FindTextInFilesTool: include default max results and cap
2026-06-30 17:28:02 +00:00
Dirk Bäumer 33dec983b5 Make max results configurable (#323729)
* Make max results configurable

* Define settings in package.json

* Sanitize config values
2026-06-30 15:19:33 +00:00
Bhavya UandCopilot 2e52a6b834 Update model capabilities (#322237)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-21 00:21:22 +00:00
Bhavya U d778afd715 Fix tool_search for GPT models; scope tool_search to deferred tools (#322235)
getAvailableTools(): skip virtual-tool grouping for any tool-search-capable endpoint (not just Anthropic). Previously GPT-5.4/5.5 ran virtual-tool grouping AND responses-API client tool search simultaneously, so real MCP tools were hidden behind activate_* groups (or trimmed) and never appeared in the request's tools map - making them searchable via tool_search but not callable.

toolSearchTool: exclude always-available (non-deferred) tools from the tool_search candidate set so the limited result slots only go to tools that actually need loading.

Fixes #317998
Fixes #317992
2026-06-20 22:44:38 +02:00
Dirk Bäumer 19afd815d6 Fix long line rendering for grep style output (#321938)
* Fix long line problem

* WIP

* Revert tag style to original code.
2026-06-18 08:28:58 -07:00
Martin AeschlimannandCopilot Autofix powered by AI 83535b58f9 Move ComputeAutomaticInstructions to extension (#314402)
* Move ComputeAutomaticInstructions to extension

* Potential fix for pull request finding

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

* update missing fullReferenceName

* update

* update

* update

* update

* update

* Remove ComputeAutomaticInstructions migration plan document

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

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

* update

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-16 19:51:49 +00:00
Dirk Bäumer 1e1a9a7af1 Optimize grep output and enhance configuration (#321601)
* Optimize grep output

* WIP

* Fix algorithm to honor maxResults

* Add output format to telemetry

* Improve boolean check
2026-06-16 23:35:07 +10:00
Bhavya U 1a8ef07a81 Update tool calling prompts and tests (#320906) 2026-06-11 08:01:46 +00:00
Bhavya U 1e79f161ce Add claude-opus-4.8 to tool search model list (#320473) 2026-06-08 14:31:13 -07:00
Vijay Upadya 5fd263f7d0 Chronicle: consolidate /chronicle standup into the skill workflow (#320031)
* Chronicle: consolidate /chronicle standup into the skill workflow

* fix test
2026-06-05 13:34:47 +10:00
Vijay Upadya b365ecd0b8 Chronicle: per-subcommand telemetry attribution for sessionStoreSql tool (#319054)
chronicle: per-subcommand telemetry attribution for sessionStoreSql tool

Add a 'subcommand' enum input on copilot_sessionStoreSql so each /chronicle slash command (standup, tips, cost-tips, search, improve, reindex) tags its tool calls. Plumb it through _invokeQuery/_invokeStandup/_invokeReindex and emit it on the chronicle.sqlQuery telemetry event (with 'unknown' for ad-hoc model calls). Also add command/target/success dimensions while preserving the legacy 'source' value so existing dashboards keep working. Update each chronicle-*.prompt.md to instruct the model to set the subcommand on every call.
2026-05-29 21:16:38 +00:00
guomaggie 8544893480 [Search Subagent] Handle context window limit exceeded error (#316529)
* truncate and retry tool calls

* keep visibility of getEndpoint

* address code review comments

* fix ci errors

* address code review comments

* add testing

* address code review comments
2026-05-27 21:50:51 +00:00
Vijay Upadya ba999257bb Chronicle cost-tips: scope to interactive VS Code chat with explicit opt-in for other agent surfaces (#318625)
* Chronicle cost-tips: scope to VS Code chat sessions

* add test
2026-05-27 20:30:22 +00:00
Vijay Upadya d96a3c83b7 Chronicle: handle undefined CapturingToken in execution_subagent (#318503)
* Chronicle: handle undefined CapturingToken in execution_subagent

* minor update
2026-05-27 05:02:01 +00:00
Harald KirschnerandCopilot 6516219662 Chronicle: fold search_subagent trajectory into parent session (#318491)
Ensures the search subagent's parentChatSessionId is always set by
falling back to the conversation's sessionId when the capturing token's
chatSessionId is unavailable. Without this fallback the search subagent
spans lacked PARENT_CHAT_SESSION_ID and were uploaded as independent
cloud sessions instead of folding into the parent.

Follow-up fix for #318463.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-26 21:41:48 -07:00
Vijay Upadya 1392847204 Chronicle: fold execution_subagent trajectory into parent session (#318475) 2026-05-27 12:11:57 +10:00
Oded S 93c53e6fc5 Fix read_cell_output incorrectly reporting all outputs as too large (#318148)
Two
 related issues caused even tiny notebook cell outputs (e.g. 5 bytes)
to be replaced with "Output is too large to be used as context".

1. Inverted size check in `RunNotebookCellOutput`: `getCharLimit` converts
   tokens to chars (×4), but it was applied to the byteLength side and
   compared against a token count. Compare byteLength against
   getCharLimit(tokenBudget / sizeLimitRatio) instead — the threshold was
   16× too small.

2. Remove `ReadCellOutput` from `toolsCalledInParallel`. Tools in that set
   are invoked eagerly with a sentinel `{ tokenBudget: 1 }` sizing on the
   premise that they don't consume sizing info. `RunNotebookCellOutput`
   does — it gates output on `sizing.tokenBudget` — so the sentinel made
   every non-empty output trip the size check. Letting it use the normal
   lazy path gives it the endpoint's real prompt budget.
2026-05-26 15:44:14 +00:00
guomaggie e64cb01425 [Search Subagent] Don't disclose paths outside of current workspace (#317213)
* wip

* filter out files outside of workspace from subagent response

* revert settings.json

* address code review comments

* retrigger gh check
2026-05-23 08:11:15 +00:00
Bhavya U 96872709b1 Messages API: skip historical thinking blocks to avoid 400s (#318076)
Anthropic returns 400 (`messages.N.content.M: 'thinking' or 'redacted_thinking'
blocks in the latest assistant message cannot be modified` and `Invalid 'data'
in 'redacted_thinking' block`) when historical thinking/redacted_thinking blocks
have lost or rotated their signature/data on round-trip — most visibly on
claude-haiku-4.5 / claude-sonnet-4.6 in agent mode (~18k hits/day).

The Anthropic Extended Thinking docs explicitly allow omitting thinking blocks
from prior assistant role turns, and on Opus 4.5+/Sonnet 4.6+ omission is
neutral for quality. Pre-#315406 (≤ 0.47) we already did this; #315406 added
'messages' to apiSupportsHistoricalThinking, which is what flipped the behavior.

Reverts only the 'messages' membership; 'responses' (OpenAI Responses API)
still needs to round-trip encrypted reasoning blocks across turns and is
unaffected. Flips the matching unit test and renames model fixtures to
claude-haiku-4-5 (the dominant in-prod offender).
2026-05-23 01:10:23 -07:00
Connor PeetandCopilot 65c56ba499 copilot: truncate long lines in read_file results (#317862)
Long lines in read_file output were getting pruned by the token-budget
prompt renderer, so the agent saw an empty result and looped — adding
unbounded session log size each retry. Truncate any line over 2000
characters at the source with a `[truncated]` marker, and append a
notice when any line was truncated so the model knows the data is
abbreviated rather than missing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-21 15:10:50 -07:00
Vijay Upadya bc13ab1981 Chronicle: Add cost-tips command (#317809)
* Chronicle: Add cost-tips command

* feedback updates
2026-05-21 14:11:44 -07:00
Vijay Upadya 5821e9663e Chronicle: Anchor SQL dialect in the tool & add skill ref to prompts (#317438)
* chronicle search

* feedback updates

* chronicle: pin dialect in tool, load skill from prompts

* feedback updates
2026-05-20 08:06:29 +02:00
Connor Peet 977a239c99 tools: correctly resolve symlinks in editFileToolUtils (#317411)
* tools: correctly resolve symlinks in editFileToolUtils

(Commit message generated by Copilot)

* fix Windows: don't realpath filesystem root in non-existent path walk
2026-05-19 16:49:32 -07:00
Alex Ross 82d052e136 Remove project setup info tool (#317284)
* Remove project setup info tool

* Fix tests

* Remove from more places
2026-05-19 15:06:32 +02: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
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
vritant24andCopilot 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
Connor PeetandConnor Peet 003011d9c2 Connor4312/msrc/119 (#38)
* mcp: show environement variables in mcp server editor

* tools: ensure apply-patch tool does not change files during healing

* mcp: show headers in server editor, too

---------

Co-authored-by: Connor Peet <connor@peet.io>
2026-05-12 10:53:13 -07:00
Bhavya U 4566b633e8 Remove github.copilot.chat.responsesApi.toolSearchTool.enabled setting (#315886)
Tool search is now always enabled for gpt-5.4/gpt-5.5, matching the
messages API path. Aligns the responses API on the same
endpoint.supportsToolSearch capability flag.

Also registers ToolSearchTool for gpt-5.4/gpt-5.5 and the
claude-opus-4.7 variants so model-specific tool gating actually
matches the supported endpoints.
2026-05-11 16:07:01 -07:00
Bhavya U cf21e2032a Remove github.copilot.chat.tools.memory.enabled setting (#315879)
Memory tool is now always enabled. Removes the preview gate, the config
key, the now-unused DI params on MemoryTool/MemoryContextPrompt/
MemoryInstructionsPrompt, and isAnthropicMemoryToolEnabled (replaced by
modelSupportsMemory at the BYOK call site).
2026-05-11 15:00:27 -07:00
Bhavya U 6b0c41bc3c Remove Copilot Memory (CAPI) feature (#315813)
Strip Copilot Memory (CAPI) feature entirely

Removes the CAPI-backed Copilot Memory that synced repository-scoped facts
to GitHub. The local file-based MemoryTool with user/session/repo scopes
remains as the sole memory mechanism.

- Delete AgentMemoryService and its test.
- Remove the github.copilot.chat.copilotMemory.enabled setting and its NLS string.
- Remove ConfigKey.CopilotMemoryEnabled.
- Strip all CAPI gating in memoryTool.tsx, memoryContextPrompt.tsx, tools.ts.
- Drop _dispatchRepoCAPI / _repoCreate / _sendRepoTelemetry.
- /memories/repo/ now always routes to local storage.
- Update memoryTool.spec.tsx: remove mock CAPI services and CAPI-only tests.
- Update simulationExtHostToolsService.ts for the new ToolsContribution arity.
2026-05-11 19:57:10 +00:00
Alex Dima b42dd65964 refactor: encapsulate working directory logic in WorkingDirectory class
Introduce a WorkingDirectory class that encapsulates the "use explicit
working directory if set, otherwise fall back to workspace folders" logic.
This replaces the pattern of passing a raw workingDirectory URI alongside
IWorkspaceService throughout tools, prompts, and confirmation helpers.

- Extension side: WorkingDirectory in platform/workspace/common/ uses
  @IWorkspaceService DI injection
- VS Code core side: WorkingDirectory in chat/common/ wraps
  IWorkspaceContextService
- Refactored inputGlobToPattern, assertFileOkForTool,
  isFileExternalAndNeedsConfirmation, isDirExternalAndNeedsConfirmation,
  createEditConfirmation, and resolveToolUri to use WorkingDirectory
- Updated prompt components (WorkspaceFoldersHint,
  MultirootWorkspaceStructure) and tool implementations
  (findFiles, findTextInFiles, searchSubagent, fetchPage)
2026-05-09 16:15:51 +02:00
Bhavya U a6ba551783 Anthropic Messages API: own cache_control placement; drop heuristic breakpoints (#315406)
* refactor: enhance cache control logic for tools and system prefixes

* refactor: enhance summarization and cache control handling in agent prompts

* refactor: remove unused countCacheControl function from messagesApi tests

* Add tests for summarization and cache control features

- Introduced a new snapshot test for summarization without cache breakpoints in `agentPrompt.spec.tsx`.
- Added a new test suite for `clearAllCacheControl` in `messagesApi.spec.ts` to validate cache control stripping and limits.
- Created a snapshot for summarization without cache breakpoints in the new snapshot file.

* test: pass enableSummarization in summarization.spec helper

The agentPrompt prop split decoupled enableSummarization from
enableCacheBreakpoints, so summarization.spec.tsx — which only set
enableCacheBreakpoints — fell through to the non-summarized branch
and broke 5 snapshot tests. Default the helper's baseProps to
enableSummarization: true so each test exercises the summarized path
as intended; individual tests can still override via otherProps.
2026-05-08 21:31:35 -07:00