Commit Graph

376 Commits

Author SHA1 Message Date
Bhavya U 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 Aeschlimann 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 Kirschner 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 Peet 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
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
Connor 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
Aaron Munger ca900cbd4d broaden definition of effectively empty, but only when re-selecting the same ws (#315308)
* broaden definition of effectively empty

* allow other files when same ws is selected
2026-05-08 11:40:12 -07:00
Alex Dima f9760df269 Add unit tests 2026-05-08 16:47:56 +02:00
Alex Dima 27ecfb15cf Thread session workingDirectory through tools, prompts, and confirmations
In the agents window, each chat session has its own working directory
that may differ from the current workspace folders (which change when
switching between sessions). This caused tools to search the wrong
folder, show spurious 'Allow reading external files?' prompts, and
render incorrect workspace_info in the system prompt.

Core plumbing:
- Add workingDirectory to IToolInvocationContext, IToolInvocationPreparationContext,
  ILanguageModelToolConfirmationRef, and IChatAgentRequest
- Enrich tool invocation context from model.workingDirectory in invokeTool()
- Include workingDirectory in toolInvocationToken built in extHostTypeConverters
- Pass workingDirectory through LanguageModelToolInvocationOptions and
  LanguageModelToolInvocationPrepareOptions (proposed API)
- Revive workingDirectory URI in extHostLanguageModelTools

Tool fixes (when workingDirectory is set, use it exclusively):
- chatExternalPathConfirmation: auto-approve paths within workingDirectory
- isFileExternalAndNeedsConfirmation / isDirExternalAndNeedsConfirmation /
  assertFileOkForTool: treat workingDirectory as workspace-internal
- createEditConfirmation: use workingDirectory for edit trust checks
- All edit tools (create_file, replace_string, multi_replace, apply_patch,
  insert_edit, edit_notebook, create_directory): pass workingDirectory
- resolveToolUri: resolve relative paths against workingDirectory
- inputGlobToPattern: scope unscoped globs to workingDirectory
- file_search / grep_search: scope searches to workingDirectory
- semantic_search: prefer workingDirectory for cwd
- run_in_terminal: prefer workingDirectory for terminal cwd
- fetchPageTool: check workingDirectory for file URI trust
- readFileTool / listDirTool / viewImageTool: pass workingDirectory

Prompt fixes:
- WorkspaceFoldersHint: show workingDirectory instead of workspace folders
- AgentMultirootWorkspaceStructure: generate file tree from workingDirectory
2026-05-08 16:15:11 +02:00
Christof Marti f73b3a3a77 Always send reasoning for same responses model (#314998) 2026-05-07 22:51:49 +09:00
Vijay Upadya 702d855d89 Honor BYOK editTools configuration in chat model picker (#314914)
* honor edit tool for BYOK

* add tests
2026-05-06 23:13:44 -07:00
Paul 639132100f Add support for per-turn ubb info (#314783) 2026-05-07 04:57:17 +00:00
Alex Ross d7bd4debee Remove search view results tool in favor of skill (#314725)
* Remove search view results tool in favor of skill

* Fix build

* Remove more references

* UPdate test specs
2026-05-06 16:10:21 +00:00
Aaron Munger 44a2ad3cf2 consider a git init on an empty folder to still be empty (#314249)
* consider a git init on an empty folder to still be empty

* fix: treat .git-only folders as effectively empty in NewWorkspaceInitializer

Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/f419373f-288a-4384-b4f4-c3389b6c6b9b

Co-authored-by: amunger <2019016+amunger@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-05-05 15:12:16 -07:00
Megan Rogge 566f6bb0ac Handle inputNeeded in execution subagent to prevent looping (#314141) 2026-05-04 15:44:19 -07:00
Vijay Upadya a2ef0ad61d Make Chronicle a Skill (#313929)
* chronicle skill

* chronicle skill updates

Co-authored-by: Copilot <copilot@github.com>

* Feedback updates

Co-authored-by: Copilot <copilot@github.com>

* tests update

* Fix tsc err

Co-authored-by: Copilot <copilot@github.com>

* few updates

---------

Co-authored-by: Copilot <copilot@github.com>
2026-05-04 14:53:31 -07:00
yemohyleyemohyle 7bf921d0e6 Yemohyle/add to ext telemetrey (#313159)
* add last asst messages logs

* add last asst messages logs ...

* add tokens info

* add parentHeaderrequestId value to subagent telemetry

* remove debug logging

* Apply suggestion from @Copilot

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

* suggested change

* extra verification

* revert suggested change

* remove debug logs

* add modelcallId and parentModelCallId to response.success telemetry

* add engine.messages logs

* fix modelCallId

* add logging

* add turnIndex to response.success

* add iterationNumber proxy for request turn

* add iterationNumber proxy for request turn to model.modelCall events

* add to response.success telemetry

* change parentRequestId to point to correct corresponding requestId

* remove debug logs

* Update extensions/copilot/src/extension/intents/node/toolCallingLoop.ts

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

* atomatic review comments changes

---------

Co-authored-by: Yevhen Mohylevskyy <yevhenmohylevskyy@Yevhens-MacBook-Pro-2.local>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-05-01 21:03:40 +00:00
Jah-yee 25c2fe34a7 fix: resolve NoChangeError tool name interpolation and typo
Use backticks for proper template literal interpolation of ${ToolName.ReadFile}.
Fix duplicate 'and and' → 'and'.
Import ToolName from registry so message stays in sync if tool name changes.

Addresses Copilot AI review feedback: keeps tool name in sync with registry.
2026-05-01 22:55:34 +08:00
Anisha Agarwal ef6a160366 Rename search_subagent to explore_subagent if explore is disabled (#312175)
* add broken starting implementation

* updated to use package.json for tool renaming

* Update extensions/copilot/src/extension/agents/vscode-node/planAgentProvider.ts

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

* remove import in prompt files

* remove getActiveSearchSubagentName now it's not used

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-30 22:35:07 -07:00
Vikram Nitin 396ea4809a Merge pull request #313067 from vikramnitin9/vikram/exec_subagent_async
Execution Subagent Async Behaviour
2026-04-30 13:08:08 -05:00
Matt Bierner 3b7dc50c85 use null 2026-04-29 12:31:51 -07:00
Matt Bierner d3119d4419 Include the isAvailable check in the codebase timeout 2026-04-29 12:06:32 -07:00
Vikram Nitin d6b2a0bdf5 Relocated interface from prompt file 2026-04-29 18:48:59 +00:00
Vikram Nitin c82fc5b488 Added a check for when subagent calls a command async 2026-04-29 18:37:47 +00:00