* 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>
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
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.
Fixesmicrosoft/vscode#297325
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.
* Revert "Background - include repositoryPath for folder sessions (#4829)"
This reverts commit ad31f89dfa.
* Background - store workspace folder information
* 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).
Closesmicrosoft/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.
When TST (Tool Search Tool) is enabled, most tools are sent with
defer_loading: true and don't count against the context window until the
model loads them via tool_search. However, the toolTokens calculation in
agentIntent counted ALL available tools, over-estimating by ~25-30K
tokens and causing premature compaction.
Fix: filter availableTools to only non-deferred tools (via
IToolDeferralService) before calling countToolTokens() when TST is
enabled. This gives an accurate budget that reflects what the API
actually charges against the context window.
* feat: define workspace metadata OTel attributes and resolver
Add CopilotChatAttr constants for repo.head_branch_name,
repo.head_commit_hash, repo.remote_url, and file.relative_path.
Create WorkspaceOTelMetadata interface and resolveWorkspaceOTelMetadata()
helper that synchronously resolves git metadata from activeRepository.
Refs: microsoft/vscode#306397, microsoft/vscode-internalbacklog#7297
* feat: extend OTel edit events with optional workspace metadata
Add optional WorkspaceOTelMetadata param to emitEditFeedbackEvent,
emitEditHunkActionEvent, emitInlineDoneEvent, emitEditSurvivalEvent.
Existing callers compile unchanged since the new param is optional.
Refs: microsoft/vscode#306397
* feat: add workspace metadata to invoke_agent OTel span
Inject IGitService into ToolCallingLoop and spread resolved workspace
metadata (branch, commit, remote) onto the invoke_agent span attributes.
Refs: microsoft/vscode#306397
* feat: extend EditSurvivalResult with workspace metadata
Add workspace field to EditSurvivalResult interface and populate it
in EditSurvivalReporter._report() using resolveWorkspaceOTelMetadata().
The reporter already injects IGitService and has the document URI,
so no new DI is needed.
Refs: microsoft/vscode#306397
* feat: inject IGitService into UserActions and pass workspace metadata
Add workspace metadata to emitEditFeedbackEvent, emitEditHunkActionEvent,
and emitInlineDoneEvent calls in UserFeedbackService using the file URI
from each event action.
Refs: microsoft/vscode#306397
* feat: pass workspace metadata to OTel survival events
Forward res.workspace from EditSurvivalResult to emitEditSurvivalEvent
at all 4 call sites: inline_chat, code_mapper, apply_patch, replace_string.
Refs: microsoft/vscode#306397
* feat: add workspace metadata to GH telemetry edit events
Add headBranchName, headCommitHash, remoteUrl, fileRelativePath to
sendGHTelemetryEvent/sendEnhancedGHTelemetryEvent calls for:
- inline.trackEditSurvival
- fastApply/trackEditSurvival
- applyPatch/trackEditSurvival
- replaceString/trackEditSurvival
- fastApply/editOutcome
Refs: microsoft/vscode-internalbacklog#7297
* test: add unit tests for workspace metadata resolver and events
Test resolveWorkspaceOTelMetadata (branch, commit, URL, relative path,
edge cases) and workspaceMetadataToOTelAttributes (OTel key mapping).
Add tests for emitEditFeedbackEvent and emitEditSurvivalEvent verifying
workspace metadata is included/omitted correctly.
Refs: microsoft/vscode#306397
* fix: propagate IGitService to ToolCallingLoop subclasses
Pass the new IGitService constructor parameter through to super() in
all 5 ToolCallingLoop subclasses: McpToolCallingLoop,
CodebaseToolCallingLoop, DefaultToolCallingLoop,
ExecutionSubagentToolCallingLoop, SearchSubagentToolCallingLoop.
Refs: microsoft/vscode#306397
* fix: address review - URI-safe path, brace style, trim tests
- Fix path prefix false-positive by using isEqualOrParent/relativePath
instead of string startsWith (e.g. /repo matching /repo2/file.ts)
- Expand one-line if blocks to multi-line per repo coding standards
- Remove as-any mutation in test, remove trivial conversion tests,
add test for path prefix false-positive edge case
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).
Fixesmicrosoft/vscode#305956
* 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>
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.
* 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>