Skip to content
This repository was archived by the owner on May 20, 2026. It is now read-only.

Copilot CLI: Additional helpers for mult-root#4854

Draft
DonJayamanne wants to merge 66 commits into
don/plastic-guanacofrom
don/multi-root-changes
Draft

Copilot CLI: Additional helpers for mult-root#4854
DonJayamanne wants to merge 66 commits into
don/plastic-guanacofrom
don/multi-root-changes

Conversation

@DonJayamanne

Copy link
Copy Markdown
Collaborator

No description provided.

lszomoru and others added 30 commits March 29, 2026 09:42
…ead of the git extension API (#4799)

* Sessions - update workspace tracker so that it uses file watcher instead of the git extension API

* Also filter out events from the node_modules folder

* Pull request feedback
…ations (#4805)

* PromptsServiceImpl: avoid using openTextDocument to not trigger validations

* Update src/platform/promptFiles/common/promptsServiceImpl.ts

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

* fix test

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Add transcript line count to compaction summary

Expose getLineCount() on ISessionTranscriptService so the
summarization prompt can tell the model how many lines the transcript
had before compaction. This helps the model target the right region
when reading the transcript file for context recovery.

- Track lineCount on IActiveSession, increment in _bufferEntry
- On session resume, count existing lines from the file on disk
- Pass transcriptLineCount through SummarizedConversationHistory
  props to SummaryMessageElement
- Include 'The transcript had N lines before compaction' in the hint

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

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

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…sholds (#4812)

* Fix premature compaction: decouple ratio from tool tokens, raise thresholds

- Compute compaction ratios against baseBudget instead of budgetThreshold
  so users with many tools aren't penalized with earlier compaction
- Reduce safety multiplier from 0.85 to 0.90 (10% covers observed
  tokenizer discrepancy without wasting 15% of context)
- Raise background compaction kick-off from 75% to 80%

Fixes microsoft/vscode#304475

* Address PR feedback: clamp messageBudget, clarify toolTokens guard comment
* Fix background compaction not applied between tool calls

- Add addPendingSummary/pendingSummaries to Turn class for storing
  summaries before setResponse is called (mid-tool-call-loop)
- Update normalizeSummariesOnRounds to fall back to pendingSummaries
  when resultMetadata isn't available yet

* Add test for pendingSummaries fallback in normalizeSummariesOnRounds
…4785)

* Attach response output message IDs only to phased assistant messages

* noop

* Remove stray probe file

* noop2

* Remove stray probe file

* noop3

* Remove stray probe file

* adding correct messageID for the outgoing messages

* adding correct messageID for the outgoing messages

* adding correct messageID for the outgoing messages

* Update defaultIntentRequestHandler snapshots
* Background - do not stage changes for folder sessions

* Fix tests
Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion) from 1.1.12 to 1.1.13.
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](juliangruber/brace-expansion@v1.1.12...v1.1.13)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 1.1.13
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Allow invoking simulationMain with alternative action input

* Address review comments: rename CLI opts, extract pipeline, fix correctness issues

- Rename CLI options with --train- prefix (--train-input, --train-strategy,
  --train-out, --train-row-offset, --train-worker) and document all options
- Extract runInputPipeline/runInputPipelineParallel to test/pipeline/trainPipeline.ts
- Preserve original row index through parse/replay/prompt pipeline to fix
  sample numbering drift when rows are filtered out
- Fix parseSuggestedEdit: use JSON.parse for escaped text, handle missing delimiter
- Fix line number regex to accept optional space after | (WithoutSpace format)
- Clamp concurrency to >= 1, type samples as ISample[], wrap dispose in try/finally
- Gate verbose logging in loadAndParseInput behind verbose flag
- Use splitLines from existing utility instead of local duplicate

* move nes-datagen to a subcommand

* more code reuse around setting promptStrategy and model config

* Address review: use ResponseFormat, Limiter, assertNever, and raw messages

* minor refactor runPipeline

* finalize

* use POT instead of custom code

* move files from script/ to test/pipeline/

---------

Co-authored-by: ulugbekna <ulugbekna@gmail.com>
* add additional header

* Update comment to reflect both legacy and new standardized headers

Agent-Logs-Url: https://github.com/microsoft/vscode-copilot-chat/sessions/e0dd0087-6284-4ddf-93b9-bb0411f8801d

Co-authored-by: jul-stevenson <13982307+jul-stevenson@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jul-stevenson <13982307+jul-stevenson@users.noreply.github.com>
When setting the session type to "Cloud", VS Code correctly lists models available for Copilot coding agent.

However, the selected model is not honored because it is sent in the `model_name` parameter instead of the expected `model` parameter.

This switches to using the expected `model` parameter, as expected by the `RemoteAgentJobPayload` type and the underlying API.
Bumps the all group with 4 updates in the / directory: [actions/checkout](https://github.com/actions/checkout), [actions/setup-node](https://github.com/actions/setup-node), [actions/cache](https://github.com/actions/cache) and [actions/upload-artifact](https://github.com/actions/upload-artifact).


Updates `actions/checkout` from 4 to 6
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v4...v6)

Updates `actions/setup-node` from 4 to 6
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](actions/setup-node@v4...v6)

Updates `actions/cache` from 4 to 5
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](actions/cache@v4...v5)

Updates `actions/upload-artifact` from 5 to 6
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: all
- dependency-name: actions/setup-node
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: all
- dependency-name: actions/cache
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: all
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: all
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…4806)

* Clean up conversation store entries when chat sessions are disposed

Listen to onDidDisposeChatSession and schedule a 10-minute cleanup
timer for each disposed session. Accessing conversations via
getConversation, lastConversation, or addConversation resets the timer.
After the timeout fires, all entries for that session are removed from
the LRU cache.

* tweak

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

* tweak

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

---------

Co-authored-by: Copilot <copilot@github.com>
* WIP Controller Dropdowns

* WIP

* wip

* Updates

* misc

* Updates to package.json

* Fix tests
* add prompting for HiddenFamilyH

* Update src/platform/endpoint/common/chatModelCapabilities.ts

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

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ositoryManager (#4831)

* Clear workspace changes before retrieving modified files in FolderRepositoryManager

* Fix tests
* Initial plan

* Add chat.claudeAgent.includeCoAuthoredBy setting to control Claude co-attribution

Agent-Logs-Url: https://github.com/microsoft/vscode-copilot-chat/sessions/1249d941-2976-42db-8fd6-db5b00625865

Co-authored-by: pierceboggan <1091304+pierceboggan@users.noreply.github.com>

* Fix NLS description formatting for includeCoAuthoredBy setting

Agent-Logs-Url: https://github.com/microsoft/vscode-copilot-chat/sessions/1249d941-2976-42db-8fd6-db5b00625865

Co-authored-by: pierceboggan <1091304+pierceboggan@users.noreply.github.com>

* Hardcode includeCoAuthoredBy: false instead of adding a user setting

Agent-Logs-Url: https://github.com/microsoft/vscode-copilot-chat/sessions/b52d23f0-a148-444e-82e9-0e9e736ab8e5

Co-authored-by: pierceboggan <1091304+pierceboggan@users.noreply.github.com>

* Use attribution API instead of deprecated includeCoAuthoredBy

Agent-Logs-Url: https://github.com/microsoft/vscode-copilot-chat/sessions/07ad67f8-4840-4f73-b94b-636c09541fea

Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pierceboggan <1091304+pierceboggan@users.noreply.github.com>
Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
Co-authored-by: Pierce Boggan <pierceboggan14@gmail.com>
* max session logs to retain

* feedback update
When a CacheBreakpoint had no preceding content block to attach
cache_control to, rawContentToAnthropicContent created a placeholder
{ type: 'text', text: ' ' } block. The Anthropic API rejects
whitespace-only text blocks with 'text content block must contain
non-whitespace text'.

This happens in long conversations after prompt-tsx prunes content to
fit the token budget, leaving a CacheBreakpoint with no real content
before it.

Fix: defer the cache_control to the next cacheable content block. If
no subsequent block exists, silently drop it (nothing to cache anyway).

Fixes microsoft/vscode#305956
DonJayamanne and others added 29 commits March 31, 2026 03:12
* feat(otel): add telemetry for OTel feature adoption tracking

Add two MSFT telemetry events to measure OTel usage:
- otel.activated: fires once at startup with full config snapshot
  (enabled, enabledVia, dbSpanExporter, exporterType, captureContent, etc.)
- otel.exportAgentTracesDB: fires when user exports the agent-traces.db

Add enabledVia field to OTelConfig to track how OTel was enabled
(envVar, setting, otlpEndpointEnvVar, dbSpanExporterOnly, disabled).

Closes microsoft/vscode#304292

* fix: address review comments

- enabledVia: check envBool === true (not !== undefined) so
  COPILOT_OTEL_ENABLED=false + dbSpanExporter=true → 'dbSpanExporterOnly'
- hasCustomEndpoint: compare against normalized URL with trailing slash
- Rename misleading test, add new test for env=false + db=true case

* refactor: extract DEFAULT_OTLP_ENDPOINT const

Replace hardcoded 'http://localhost:4318' with a shared const in
otelConfig.ts, used by resolveOTelConfig and otelContrib telemetry.
Handles both raw and URL-normalized (trailing slash) comparisons.
…roved session management (#4855)

* Enhance Copilot CLI session handling with performance logging and improved session management

* Fix tests
…ns (#4857)

* Revert "Background - include repositoryPath for folder sessions (#4829)"

This reverts commit b3af503.

* Background - store workspace folder information
…unused imports (#4860)

* refactor(CopilotCLI): streamline chat history retrieval and clean up unused imports

* Fix test failures
* nes: debt: remove unused param

* nes: patch: add no-op diff patch test

* nes: logs: include filter names when filtered
* Background - maintain repository path for folder session

* Fix tests
…ailable (#4871)

* Make sure we still enable code search when only external ingest is available

* Better logging

* Also update telemetry

* Check disposal
Add TeamInternal settings for configuring reasoning effort:
- chat.advanced.responsesApiReasoningEffort: for Responses API
- chat.advanced.anthropicThinkingEffort: for Anthropic thinking

These are hidden settings (not in package.json) used by evals to
configure reasoning/thinking effort without affecting end users.
Setting takes priority over per-request model picker value.
Per VS Code UX guidelines, quick pick titles should not be used when
the placeholder already describes the purpose. Removes the title from
both the 'Show Memory Files' and Claude '/memory' quick picks.

Fixes microsoft/vscode#297325
These are core language tools that should always be immediately available
without requiring tool_search discovery. They are on par with other core
tools like run_in_terminal and get_errors.

Refs microsoft/vscode#297585
* delete chat replay feature

* update snapshots
…paction is enabled (#4868)

* Attach response output message IDs only to phased assistant messages

* noop

* Remove stray probe file

* noop2

* Remove stray probe file

* noop3

* Remove stray probe file

* adding correct messageID for the outgoing messages

* adding correct messageID for the outgoing messages

* adding correct messageID for the outgoing messages

* Update defaultIntentRequestHandler snapshots

* [Revert:]including previous responseId for all the requests when compaction is enabled
…opilot CLI (#4772)

* Add customization providers for Claude and Copilot CLI chat sessions

* Add unit tests for chat session customization providers

Add tests for ClaudeCustomizationProvider and CopilotCLICustomizationProvider
covering metadata, item discovery, and change event forwarding. Refactor
metadata from static readonly to static getter for testability (avoids
class initializer accessing vscode.ChatSessionCustomizationType before
shim setup).

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

* Fix customization provider accuracy: add hook discovery, mark unsupported types

- Claude provider now discovers hooks from .claude/settings.json and
  .claude/settings.local.json (workspace + user home), reporting them
  as ChatSessionCustomizationType.Hook items with event/matcher names
- Copilot CLI provider marks both Hook and Prompt as unsupported since
  it doesn't support hooks and prompt files aren't enumerable via the API
- Claude provider now takes IWorkspaceService, IFileSystemService, and
  INativeEnvService to read settings files for hook discovery
- Added 6 new hook discovery tests covering workspace/user settings,
  multiple matchers, invalid JSON, and missing files

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

* Mark Agent as unsupported for Claude customization provider

Claude doesn't use .agent.md files — it has its own agent system via
CLAUDE.md memory files and the Claude Agent SDK. Remove Agent items
from Claude's provideChatSessionCustomizations output and add Agent
to its unsupportedTypes metadata.

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

* Remove workspaceSubpaths from API, add internal path filtering

Remove the workspaceSubpaths property from ChatSessionCustomizationProviderMetadata
since the extension should filter internally. Each provider now only returns items
under its relevant paths:

- Claude: instructions/skills under .claude/ (workspace folders + user home)
- Copilot CLI: instructions/skills under .github/ or .copilot/ (agents are always
  included since they're Copilot-specific)

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

* Add TODO comments for work in progress on chatSessionCustomizationProvider API

* Sync chatSessionCustomizationProvider d.ts with VS Code origin/main

Add groupKey, badge, and badgeTooltip fields to ChatSessionCustomizationItem
to match upstream changes from #305810 and #305813.

The providers don't set these fields explicitly — the VS Code UI
auto-enriches instruction items by parsing frontmatter when groupKey
is not provided.

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

* sessions: Claude customization provider uses SDK runtime data

- Add IClaudeRuntimeDataService to cache agents from Query.supportedAgents()
- ClaudeCodeSession calls runtimeDataService.update() after query creation
- Rewrite ClaudeCustomizationProvider:
  - Agents: reported from SDK via IClaudeRuntimeDataService (built-in groupKey)
  - Instructions: hard-coded CLAUDE.md paths with existence checks
  - Skills: filtered from IChatPromptFileService under .claude/
  - Hooks: unchanged (from .claude/settings.json)
- unsupportedTypes changed from [Agent, Prompt] to [Prompt] only
- 28 tests (22 provider + 6 service)

* sessions: Copilot CLI customization provider uses runtime agent data

- Inject ICopilotCLIAgents to enrich agents with displayName/description
- Expand path filter: add .agents/ to CLI_SUBPATHS
- Add home directory support: ~/.copilot/, ~/.agents/
- Listen to ICopilotCLIAgents.onDidChangeAgents for change events
- 21 tests covering new paths, agent enrichment, and events

* fix: register IClaudeRuntimeDataService in test services

The existing claudeCodeAgent tests were failing because ClaudeCodeSession
now depends on IClaudeRuntimeDataService, but it was not registered in
createExtensionUnitTestingServices().

* sessions: implement correct chatSessionCustomizationProvider for Claude and Copilot CLI

Claude provider:
- New IClaudeRuntimeDataService to cache SDK Query agents
- Hybrid agent approach: file-based .claude/ agents pre-session, SDK agents post-session
- Instructions from hard-coded CLAUDE.md paths (stat-checked)
- Skills from .claude/skills/ via IChatPromptFileService
- Hooks from .claude/settings.json (unchanged)
- Per-category debug logging with names

Copilot CLI provider:
- ICopilotCLIAgents as primary agent source (SDK + prompt files)
- Path filter expanded to .github/, .copilot/, .agents/
- Home directory support (~/.copilot/, ~/.agents/)
- Agent enrichment with displayName/description from SDK

Menu contributions:
- chat/customizations/create for Claude agents, hooks, instructions sections

Code review fixes:
- Use stat() instead of readFile() for existence checks
- Fire-and-forget runtimeDataService.update() to avoid blocking session startup
- Restore vscode.ChatSessionCustomizationType in test afterEach
- Type-safe makeSweAgent helper (no as any)

* claude: mark plugins as unsupported type

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add supportsReasoningEffort to BYOKModelCapabilities interface
- Build configurationSchema with effort picker UI via buildBYOKConfigurationSchema
- Gate effort on supportsReasoningEffort capability array instead of supportsAdaptiveThinking
- Support 'max' effort level (Opus 4.6 exclusive)
…file logging (#4890)

* Add configurable max session log size setting for debug file logging

* update
* Enrich chat debug JSONL logs

* feedback update

* Feedback update2
* nes: pipeline: add e2e tests

* address review: conditional catch + toMatchFileSnapshot
@DonJayamanne DonJayamanne force-pushed the don/multi-root-changes branch from fef5298 to 56ff00d Compare April 1, 2026 09:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.