Commit Graph

80 Commits

Author SHA1 Message Date
Don Jayamanne
847d569028 chore: update @github/copilot and related dependencies to version 1.0.61 (#320868)
* chore: update @github/copilot and @github/copilot-sdk to version 1.0.61 and 1.0.1 respectively

- Bump @github/copilot from 1.0.60 to 1.0.61 in package.json and package-lock.json
- Update @github/copilot-sdk from 1.0.0 to 1.0.1 in package.json and package-lock.json
- Modify postinstall script to copy tgrep files instead of sharp files
- Update tests to include tgrep binaries
- Change model in e2e tests from 'claude-opus-4.7' to 'gpt-5-mini'

* fix: add libm.so.6(GLIBC_2.27)(64bit) to referenceGeneratedDepsByArch
2026-06-11 20:46:55 +10: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
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
Bhavya U
6b5334c5f4 feat: make stream a caller-controlled passthrough in Messages API (#311003)
* feat: make stream a caller-controlled passthrough in Messages API

Allow callers to set stream: false via requestOptions instead of
hardcoding stream: true. Add non-streaming response handler for the
Anthropic Messages API that parses single JSON responses.

- createMessagesRequestBody: stream: true → options.requestOptions?.stream ?? true
- preparePostOptions: stream: true as default before spread (callers can override)
- processResponseFromMessagesEndpoint: auto-detect via Content-Type header
- processNonStreamingResponseFromMessagesEndpoint: new handler for JSON responses
  with tool call support in finishedCb delta, defensive parsing, cache-token
  consistency warning, unknown block type logging
- Remove stale 'stream not respected' comment from fetch.ts
- Remove stream: false from agentIntent.ts inline summarization
- 10 new tests for non-streaming handler

* fix: add telemetry parity for non-streaming path and bump cache salt

* regenerate simulation cache for review-inline tests

* Regenerate simulation cache after rebase

* Temporarily disable multifile-edit-claude variant (#315940)

claude-3.5-sonnet returns model_not_supported from the endpoint, breaking
simulation cache regen. Re-enable when the test is updated to use a
currently-supported Claude model.

* Fix terminal strict-mode crash on empty suggestions + update baseline

- terminal.stest.ts: guard strict-mode `ok()` predicate so when the model
  returns no code block, the test fails cleanly with the existing message
  instead of crashing with 'Cannot read properties of undefined (reading match)'.
  Also drop the stale commented-out debug block.
- baseline.json: refresh scores (68.01 -> 68.69) and drop the 14 entries for
  the disabled multifile-edit-claude variant (see #315940).
- Remove now-orphaned multifile-edit-claude-panel.json outcome file.

* Apply CI-observed score improvements for cpp inline scenarios

CI on Linux scores 4 cpp InlineChatIntent scenarios higher than my local
macOS run does (likely platform-specific line-ending/whitespace normalization
in the cpp grader). Update baseline.json to match the Linux scores:

- edit-InlineChatIntent [inline] [cpp] - edit for cpp:               5 -> 9
- edit-InlineChatIntent [inline] [cpp] - edit for macro:             0 -> 2
- generate-InlineChatIntent [inline] [cpp] - cpp code generation:    3 -> 10
- generate-InlineChatIntent [inline] [cpp] - templated code gen:     0 -> 10

Overall score: 68.69 -> 68.86.

* Populate cpp diagnostic cache via Docker for cross-platform parity

The earlier rebase cache regen produced new LLM responses for the cpp
inline tests but failed to populate the clang diagnostic provider cache
for those new inputs, because clang detection on macOS is broken (Apple
clang prints '-v' output to stderr, but findIfInstalled only checks
stdout) and Docker wasn't running. As a result the cpp diagnostic cache
was missing entries for the new LLM responses, and CI re-ran clang live
on each platform with diverging results:

  - Linux CI:   clang available, scored highest (9, 2, 10, 10)
  - Windows CI: no clang, errored out (5, 0, 10, 10 with worsening)
  - macOS:      Apple clang misdetected as missing, Docker off, errored

This commit:

  1. Bumps CLANG_DIAGNOSTICS_PROVIDER_CACHE_SALT 5 -> 6 to invalidate
     any contaminated entries.
  2. Adds two new cache layers populated by running cpp tests via Docker
     (using the mcr.microsoft.com/devcontainers/cpp image, same Linux
     clang as CI). All 14 cpp scenarios now produce deterministic,
     platform-independent diagnostic results when read from cache.

Verified with --require-cache: all cpp scenarios pass without invoking
clang/docker at runtime.
2026-05-11 21:59:58 -07:00
Ladislau Szomoru
31d554803a Agents - improve state management for session operation (#315492) 2026-05-09 22:19:57 +00:00
Ladislau Szomoru
6c4a7f8b6d Copilot - scaffold method to eagerly refresh changes cache (#315468)
* Agents - do not show "Mark as Done" while a git operation is in progress

* Copilot - scaffold method to eagerly refresh changes cache

* Fix tests
2026-05-09 19:16:52 +02:00
Ladislau Szomoru
7d24158495 Initial implementation (#314957) 2026-05-07 14:24:47 +02:00
Don Jayamanne
3b2b5e066d Update GitHub Copilot npm and permission handling (#313364)
* update github copilot npm and update permission handling to use 'approve-once' instead of 'approved'

* Updates

* Fix permissionHelpers tests: update 'approved' to 'approve-once' and fix conditional check

Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/6e5d31b2-034c-4c94-8145-c6a5c7c9c81b

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

* Add setPermissionsRequired to MockCliSdkSession test helper

Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/25f015e8-12a6-41d3-84b5-26cc1ef86ea1

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

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-04-29 19:07:15 -07:00
Don Jayamanne
f5d02ffd6d Add event emitters for workspace folder and worktree changes (#312288)
* Add event emitters for workspace folder and worktree changes; improve cache management

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

* Update extensions/copilot/src/extension/chatSessions/common/chatSessionWorktreeService.ts

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

* Update extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLIChatSessions.ts

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

* Enhance chat session item handling by eagerly including changes for refreshed sessions to improve UX

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

* Change defaults

* Fixes

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

---------

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-23 20:50:21 -07:00
Don Jayamanne
c385fd3dde feat(copilot): enable lazy loading for chat session items and update related configurations (#312047)
* feat(copilot): enable lazy loading for chat session items and update related configurations

* updates
2026-04-23 06:34:22 +00:00
Don Jayamanne
8c4616c5d4 feat(copilotcli): Perf impromvent by lazy loading chat session items (#311817)
* feat(copilotcli): add lazy loading for chat session items

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

* Update extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLIChatSessions.ts

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

* Update extensions/copilot/package.nls.json

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

* Updates

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

---------

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-22 17:16:21 -07:00
Martin Aeschlimann
bf8712457a use IPromptsService to provide customizations (#309873)
* use IPromptsService to provide customizations

* update

* update

* update

* update

* Update extensions/copilot/src/platform/promptFiles/test/common/mockPromptsService.ts

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

* update

* dispose MockPromptsService

* update

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-15 00:40:03 -07:00
Ladislau Szomoru
43b1f4bd8b Agents - remove "Update Branch" command (#309375)
* Agents - remove "Update Branch" command

* Remove more code
2026-04-13 01:06:58 -07:00
Don Jayamanne
c7fd971659 refactor: remove getSessionIdForWorkspaceFolder method and update clearWorkspaceChanges to handle both session IDs and folder URIs (#308644)
* refactor: remove getSessionIdForWorkspaceFolder method and update clearWorkspaceChanges to handle both session IDs and folder URIs

* Address comments
2026-04-09 11:19:33 +00:00
Don Jayamanne
0afa58dace feat(copilot): Updated the Copilot CLI options to support a model interface (#308418)
* feat(copilot): Updated the Copilot CLI optoins to support a model interface

* Fix tests
2026-04-07 21:43:05 -07:00
Don Jayamanne
cc27248bda Update dependencies and improve session initialization in Copilot CLI (#4930)
* Update dependencies and improve session initialization in Copilot CLI

* Update package.json

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

* Update to 1.0.17

* Updates

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-05 15:37:26 +00:00
Don Jayamanne
a7af848fb1 Update command handling in Copilot CLI with corresponding descriptions (#4927)
* Update command handling in Copilot CLI with corresponding descriptions

* Update src/extension/chatSessions/copilotcli/node/copilotcliSession.ts

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

* Update src/extension/chatSessions/copilotcli/node/copilotcliSession.ts

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

* Updates

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-02 01:29:39 +00:00
Don Jayamanne
464d963149 refactor: update session options to use consistent naming and structure across session management (#4878) 2026-03-31 19:56:32 +00:00
Don Jayamanne
bfc7d31943 refactor(CopilotCLI): streamline chat history retrieval and clean up unused imports (#4860)
* refactor(CopilotCLI): streamline chat history retrieval and clean up unused imports

* Fix test failures
2026-03-31 09:23:30 +00:00
Don Jayamanne
5504188a37 Copilot CLI: Use type-only imports from '@github/copilot/sdk' (#4852) 2026-03-31 03:02:59 +00:00
Don Jayamanne
408faf1866 Copilot CLI: Remove CopilotCLISessionOptions (#4853)
* Copilot CLI Remove CopilotCLISessionOptions

* Updates
2026-03-31 03:02:30 +00:00
Paul
41b7ef8514 Support dynamic prompt variables (#4742)
* wip

* fixes

* update

* update

* updates

* updates

* clean

* clean

* clean

* fix tests

* update

* fix test
2026-03-27 21:55:42 +00:00
Don Jayamanne
b7e641a910 feat: Fix MCP server mapping integration in Copilot CLI sessions (#4709)
* feat: Fix MCP server mapping integration in Copilot CLI sessions

* Updates

* Updates

* Updates

---------

Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>
2026-03-27 03:48:35 +00:00
Matt Bierner
7e46172b15 Remove workspace metaprompt (#4737)
For https://github.com/microsoft/vscode/issues/292972

The tool calls do this for us now
2026-03-26 22:39:33 +00:00
Don Jayamanne
b32658f1ed Copilot CLI: Incremental updates for Controller API adoption (#4657)
* Copilot CLI: Incremental updates for Controller API adoption

* updaets

* Updates

* Updates

* Skip tests

* Run claude tests

* Restore more tests

* Updates

* Updates

* Updates

* Updates

* updates
2026-03-25 17:59:39 +00:00
Don Jayamanne
c2384c79d4 feat: Enhance ChatSessionMetadataStore with request details management (#4487)
* feat: Enhance ChatSessionMetadataStore with request details management

* Potential fix for pull request finding

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

* Updates

* Potential fix for pull request finding

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

* Updates

* Fixes

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-18 14:50:57 +00:00
Don Jayamanne
effab7e589 More updates to Copilot CLI to use Controller API (#4368)
* More updates to Copilot CLI to use Controller API

* Update src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts

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

* Updates

* fixes

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-12 04:43:03 +00:00
Don Jayamanne
eab9152c45 Copilot CLI Plan exit approval (#4315)
* Copilot CLI Plan exit approval

* skip test
2026-03-10 11:12:49 +00:00
Don Jayamanne
da009e049a Refactor CopilotCLIPromptResolver for multi-workspace support (#4294)
* Refactor CopilotCLIPromptResolver to support multi-workspace handling and update related tests

* Updates

* Update src/extension/chatSessions/copilotcli/node/copilotcliPromptResolver.ts

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

* Updates

* Updaets

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-09 13:12:08 +00:00
Don Jayamanne
24c0c3dbce Update github copilot npm (#4274)
* Update github copilot extension

* Update tool calls

* Updates
2026-03-08 06:10:16 +00:00
Don Jayamanne
79d6023696 Refactor workingDirectory, isolationEnabled and worktreeProperties and collapse into an existing single type (#4276)
* Refactor Copilot CLI session handling to utilize workspace information

- Introduced IWorkspaceInfo interface to encapsulate workspace-related data.
- Updated session creation and retrieval methods to accept workspaceInfo instead of individual parameters.
- Refactored tests to align with the new workspaceInfo structure.
- Enhanced session management by ensuring consistent handling of working directories and isolation settings.
- Improved prompt resolution by passing workspaceInfo to relevant methods.

* Updates

* Refactor CopilotCLISessionOptions to remove workingDirectory property and streamline working directory retrieval

* Fixes
2026-03-07 12:33:47 +00:00
Logan Ramos
62215a8a23 Remove hard coded gpt 4.1 in favor of copilot base (#4124)
* Remove hard coded gpt 4.1 in favor of copilot base

* Update simulator cache
2026-03-02 22:05:28 +00:00
Don Jayamanne
c1c606c16d Merge agents and chatsession folder (#4058) 2026-02-27 23:06:09 +00:00
Don Jayamanne
ec5cdffed5 Refactor askUserQuestion method to remove unused stream parameter (#3925)
* Refactor askUserQuestion method to remove unused stream parameter across multiple files

* Updates

* Fix compilation issues after merging main

* Remove unused type
2026-02-24 18:01:07 +00:00
Don Jayamanne
0a57b962d2 Upgrade to latest version of github copilot npm (#3923)
* Upgrade to latest version of github copilot npm

* Apply suggestion from @Copilot

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

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-23 01:50:22 +00:00
Harald Kirschner
7aa17fc25e fix: align promptCategorization.requestId with panel.request for telemetry joins (#3874)
Co-authored-by: Harald Kirschner <digitarald@gmail.com>
2026-02-19 23:57:48 +00:00
Don Jayamanne
58151ec8fe Adopt the latest github copilot npm (#3786)
* Adopt the latest github copilot npm

* Updates

* Updates

* Updates

* Updates

* Fixes

* Fixes

* Fixes

* Fixes

* Updates to the tests

* Fix tests
2026-02-19 08:46:17 +00:00
Don Jayamanne
242fffd027 Update background handling of update_todo tool (#3845) 2026-02-19 05:51:20 +00:00
Don Jayamanne
b7ebca4bfb Add authorization checks in Background agents (#3705)
* Add authorization checks in Background agents

* fix tests

* Fixes

* Fixes with tests

* Updates

* Fix tests
2026-02-17 23:59:44 +00:00
Don Jayamanne
d316210e87 Enhance Copilot CLI integration with built-in model picker (#3757)
* Use built-in model dropdown for background agents

* Fixes

* Support compact command in background agent

* Revert tests
2026-02-16 04:38:35 +00:00
Rob Lourens
a4ffdcf03b Sync chatParticipantPrivate.d.ts with vscode (#3734)
* Sync chatParticipantPrivate.d.ts

* Sync ChatRequestEditorData with vscode
2026-02-13 21:07:31 +00:00
Rob Lourens
84b8b46bd5 Add session transcript service for hooks (#3545)
* Add session transcript service for hooks

Implement JSONL-based session transcript service that records
conversation turns, tool executions, and assistant messages for
hook consumers.

Key changes:
- New ISessionTranscriptService interface and SessionTranscriptService
  implementation with buffered writes and automatic old transcript cleanup
- Integrate transcript logging into tool calling loop: user messages,
  assistant messages, tool execution start/complete, turn boundaries
- Auto-flush transcript and inject transcript_path into hook input
- Race flush with 500ms timeout to avoid blocking hook execution
- Gate transcript creation on ChatRequest.hasHooksEnabled
- Include copilotVersion and vscodeVersion in session.start entry
- Add timestamp to IToolCallRound for transcript timing
- Add hasHooksEnabled to ChatRequest interface and all implementors

* Fixes
2026-02-07 02:04:46 +00:00
Connor Peet
ba2e206efe tools: cleanup unused pause logic (#3488)
We removed the 'pause' feature back in ~June, cleanup logic we still had
around it. This removes:

- The PauseController class which was no longer being used
- onPaused event parameters from chat participant, request, and intent
  handlers
- Pause-related event listening and stream pausing logic
- Simplified throwIfCancelled to be synchronous since it no longer needs
  to wait for pause resumption

(Commit message generated by Copilot)
2026-02-05 18:24:07 +00:00
Connor Peet
8ca2807e66 chat: wire up yieldrequested for steering messages (#3473)
* chat: wire up yieldrequested for steering messages

Allows the client to do a 'soft cancel' after a tool call happens before returning back to the model, or before the next turn.

* fix compile
2026-02-05 16:05:57 +00:00
Don Jayamanne
0e7329b0ac background agent stests to verify grep/glob tools (#3445)
* background agent stests to verify grep/glob tools

* Skip
2026-02-04 20:32:43 +00:00
Don Jayamanne
68dd8b04dc Auto approve viewing of attached images (#3223)
* Trust images created by BG session

* Updates

* Updates to display name

* Update src/extension/prompts/node/agent/copilotCLIPrompt.tsx

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

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-28 06:46:30 +00:00
Don Jayamanne
44a6166c55 Update Copilot CLI stests to include mcp server (#3107) 2026-01-23 07:50:36 +00:00
Connor Peet
ba56721dfa tools: add support for model-specific tool registration (#2857)
* tools: add support for model-specific tool registration

This PR goes with https://github.com/microsoft/vscode/pull/287666

This allows the registration of tools that are scoped to specific
language models. These tools can be registered at runtime with
definitions derived from e.g. the server.

I think we should adopt this and go away from the current
`alternativeDefinitions` pattern which we have used previously.

Example of having tools specific for GPT 4.1 vs 4o:

```ts
ToolRegistry.registerModelSpecificTool(
	{
		name: 'gpt41_get_time',
		inputSchema: {},
		description: 'Get the current date and time (4.1)',
		displayName: 'Get Time (GPT 4.1)',
		toolReferenceName: 'get_time',
		source: undefined,
		tags: [],
		models: [{ id: 'gpt-4.1' }],
	},
	class implements ICopilotTool<unknown> {
		invoke() {
			return new vscode.LanguageModelToolResult([new vscode.LanguageModelTextPart('Current year is 2041 (GPT 4.1)')]);
		}
	}
);

ToolRegistry.registerModelSpecificTool(
	{
		name: 'gpt4o_get_time',
		inputSchema: {},
		description: 'Get the current date and time (4o)',
		displayName: 'Get Time (GPT 4o)',
		toolReferenceName: 'get_time',
		source: undefined,
		tags: [],
		models: [{ id: 'gpt-4o' }],
	},
	class implements ICopilotTool<unknown> {
		invoke() {
			return new vscode.LanguageModelToolResult([new vscode.LanguageModelTextPart('Current year is 2040 (GPT 4o)')]);
		}
	}
);
```

* demo

* fix

* overrides

* add overridesTool

* fix inverted logic

* test fixes and back compat

* make memory tool model specific

* fix tests and contribute memory to the vscode toolset

* verison

* fix unit tests

* rm config

* fix missing askquestions

---------

Co-authored-by: bhavyaus <bhavyau@microsoft.com>
2026-01-22 18:34:05 +00:00
Don Jayamanne
dfaa4f6d5f Update Github Copilot to latest version (#2864)
* Update to latest version of Github Copilot CLI

* Use 0.0.381

* Reverts

* Update src/extension/agents/copilotcli/node/copilotcliSession.ts

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

* Updates

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-15 01:36:52 +00:00
Don Jayamanne
d185680f57 Fix race conditions when running CLI stests (#2805) 2026-01-13 04:47:52 +00:00