* Simple classifier
* Add classification guidance to clarify signals are illustrative, not exhaustive
Addresses feedback from PR review to help the classifier understand that keywords,
signals, and examples are hints about categories, not an exhaustive list to match against.
* Add unknown_scope for consistency with unknown_domain
* fix: Reject empty 'PT' in ISO 8601 duration validation
The regex now uses a negative lookahead (?-200) to ensure at least one
time component (hours, minutes, or seconds) is present after 'PT'.
* feat: Add unknown_intent category to taxonomy
Fallback category for messages that are too ambiguous to classify
into any specific intent.
* feat: Add workspace and editor context to categorization prompt
Replace manual context signals with WorkspaceStructure and
CurrentEditor prompt components for richer context. These components
automatically gather relevant project and editor state.
* feat: Add currentLanguage to categorization telemetry
Capture the active editor's language ID for better analysis of
prompt classification patterns across different programming languages.
* Use tool calling for structured prompt categorization output
* Refine prompt categorization context and usage
---------
Co-authored-by: Harald Kirschner <digitarald@gmail.com>
Introduce a new Claude Code Session Parser module that provides type-safe
parsing of Claude Code session files stored in JSONL format.
## Architecture
The previous monolithic claudeCodeSessionService.ts is now split into:
- sessionParser/claudeSessionSchema.ts - Type-safe validators using IValidator pattern
- sessionParser/claudeSessionParser.ts - Core parsing and session building logic
- sessionParser/claudeCodeSessionService.ts - VS Code service with caching
## Flow Diagram
```mermaid
flowchart TB
subgraph "Entry Points"
A[ClaudeChatSessionItemProvider] --> |getAllSessions| B[IClaudeCodeSessionService]
C[ClaudeChatSessionContentProvider] --> |getSession| B
end
subgraph "Service Layer"
B --> D[ClaudeCodeSessionService]
D --> |metadata cache| E[_metadataCache]
D --> |full session cache| F[_fullSessionCache]
end
subgraph "Directory Discovery"
D --> G[_getProjectSlugs]
G --> |single folder| H[computeFolderSlug]
G --> |multi-root| I[process.cwd slug]
H & I --> J[~/.claude/projects/slug/]
end
subgraph "Metadata Extraction - Lightweight"
D --> |list sessions| K[extractSessionMetadataStreaming]
K --> |streaming readline| L[processLineForMetadata]
L --> |early termination| M[IClaudeCodeSessionInfo]
end
subgraph "Full Session Loading"
D --> |load session| N[parseSessionFileContent]
N --> |each line| O[parseSessionEntry]
O --> P{Entry Type}
P --> |user| Q[vUserMessageEntry]
P --> |assistant| R[vAssistantMessageEntry]
P --> |summary| S[vSummaryEntry]
P --> |chain-link| T[vChainLinkEntry]
P --> |queue-op| U[vQueueOperationEntry]
end
subgraph "Session Building"
Q & R & S & T --> V[buildSessions]
V --> W[Find Leaf Nodes]
W --> X[Build Parent Chain]
X --> Y[Resolve Chain Links]
Y --> Z[Deduplicate by ID]
Z --> AA[IClaudeCodeSession]
end
subgraph "Subagent Loading"
D --> |has subagents dir| AB[_loadSubagentsForSession]
AB --> |agent-*.jsonl| AC[_parseSubagentFile]
AC --> AD[buildSubagentSession]
AD --> AE[ISubagentSession]
AE --> AA
end
```
## Key Improvements
- **Type Safety**: Replaced unsafe `as` casts with composable IValidator<T> pattern
- **Error Handling**: Added detailed ParseError with line numbers and context
- **Performance**: Streaming metadata extraction with early termination for listings
- **Cycle Detection**: Proper cycle detection with visited sets (vs potential infinite loops)
- **Separation of Concerns**: Clean schema → parser → service layers
## Changes
- Moved `claudeCodeSessionService.ts` to `sessionParser/` directory
- Added type guards for TextBlock, ThinkingBlock, ToolUseBlock, ToolResultBlock
- Updated imports in chatSessions.ts, claudeChatSessionContentProvider.ts,
claudeChatSessionItemProvider.ts
- Added comprehensive test coverage (~2500 lines) for schema, parser, and service
- Added README.md documenting the module architecture and future improvements
* Update Anthropic SDK packages
### `@anthropic-ai/sdk` (0.71.2 → 0.72.1)
#### Features
- Structured Outputs support in Messages API
- MCP SDK helper functions
#### Breaking Changes
- `output_format` → `output_config` parameter migration
### `@anthropic-ai/claude-agent-sdk` (0.2.5 → 0.2.31)
#### Features
- **Query interface:** Added `close()` method, `reconnectMcpServer()`, `toggleMcpServer()` methods
- **Sessions:** Added `listSessions()` function for discovering resumable sessions
- **MCP:** Added `config`, `scope`, `tools` fields and `disabled` status to `McpServerStatus`
- **PDF support:** Added `pages` field for reading specific page ranges
- **Debugging:** Added `debug` and `debugFile` options
- **Results:** Added `stop_reason` field to `SDKResultSuccess` and `SDKResultError`
- **Hooks:** Added notification hook support
#### Bug Fixes
- Fixed `mcpServerStatus()` to include tools from SDK and dynamically-added MCP servers
- Fixed PermissionRequest hooks in SDK mode
- Fixed structured output validation errors and empty assistant message handling
#### Breaking Changes
- `KillShellInput` → `TaskStopInput`: Updated type mapping in claudeTools.ts
Also improved upgrade documentation in AGENTS.md with GitHub release URLs
and consolidated summary format guidance.
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix erroring out by deleting the base's value of temperature & top_p, honoring the request.
---------
Co-authored-by: Claude <noreply@anthropic.com>
* add a search agent endpoint & call it
* toggle between main and proxy
* add toggle that checks for manually set setting for agentic proxy
* update to use agentic proxy
* update package jsons to reflect new setting
* search subagent should be enabled for proxy to be enabled
* change to settings.json to trigger search subagent with proxy
* make config settings non-advanced
* remove search subagent settings
* Add config parsing tests
* Update comment
* Add validation for rejectedScore > ignoredScore > acceptedScore
* Replace unnecessary generic type with declared type
* Send telemetry event incorrectNesAdaptiveAggressivenessConfig
* Update tests for new type declaration
* Update tests for telemetry update
* Fix validation
* Add telemetry tests for config validation
* Test actual config that was set
* Cloud checking for single repository
* Decide caller when to add the options and when not to
---------
Co-authored-by: Josh Spicer <23246594+joshspicer@users.noreply.github.com>
Chat telemetry events (copilot-chat/*) were missing the enterprise_list
property that completions telemetry correctly includes. This caused
enterprise usage data to appear incomplete in reports.
Changes:
- Add enterpriseList to ITelemetryUserConfig interface
- Update TelemetryUserConfigImpl to extract enterprise_list from token
- Update TelemetryData.extendWithConfigProperties() to include enterprise_list
- Add unit tests for enterprise_list telemetry propagation
* Add Xtab275EditIntent prompting strategy with edit intent filtering
This adds a new prompting strategy that extends Xtab275 with edit intent
tag parsing. The model returns an edit_intent tag indicating confidence
level (no_edit, low, medium, high), which is then filtered against the
user's aggressiveness level.
Filtering logic:
- no_edit: Never show
- low intent: Show for all aggressiveness levels
- medium intent: Show for low/medium aggressiveness
- high intent: Only show for low aggressiveness
Changes:
- Add EditIntent enum and namespace with parsing and filtering logic
- Add EditWindowWithEditIntent response format
- Add Xtab275EditIntent prompting strategy
- Implement parseEditIntentFromStream in xtabProvider
- Add editIntent telemetry field
- Add comprehensive unit tests for EditIntent
Co-authored-by: GitHub Copilot <noreply@github.com>
* Short circuit when we hit a no_edit or low-confidence edit, and skip parsing the rest of the response
* Add an experimental key to telemetry to log parse errors for edit intent
* Change the filtering logic so there's only one place where edit intent short-circuits to skip the rest of the stream
* Add tests for parsing edit stream
* Log unknown values parsed during edit intent parsing
* Clean up tests
* Fix failing test by actually returning expected error
* Remove unused method
* Testing
* Fix bug where premature promise resolution was causing error streaming response
* Fix flipped confidence levels mapping to aggressiveness!
* Update comment
* Add manual test cases
* Remove manual tests
* Remove edit intent from log context
* Update doc comments
* Fix indentation src/platform/inlineEdits/common/dataTypes/xtabPromptOptions.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Add parser for short edit intent tags
* Support short edit intent tags through another prompting strategy
* Remove unnecessary change
* Fix switch case
* Fix missing cases
* Update test constant 🤦
---------
Co-authored-by: Ben Steenhoek <bensteenhoek@microsoft.com>
Co-authored-by: GitHub Copilot <noreply@github.com>
Co-authored-by: Benjamin Steenhoek <bstee615@github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* feat(inlineEdits): make user happiness score algorithm configurable
Add UserHappinessScoreConfiguration interface and experiment-based config
to allow tuning the happiness score calculation via experiments:
- Add configurable score weights (acceptedScore, rejectedScore)
- Add configurable thresholds (highThreshold, mediumThreshold)
- Add InlineEditsUserHappinessScoreConfigurationString config key
- Load configuration from experiment service with JSON validation
The algorithm behavior remains unchanged with default values matching
the original hardcoded implementation (accepted=1, rejected=0,
highThreshold=0.7, mediumThreshold=0.4).
* feat(inlineEdits): add ignored action tracking to happiness score
Add support for tracking when users ignore (neither accept nor reject)
inline edit suggestions:
- Add 'ignored' action type alongside 'accepted' and 'rejected'
- Add handleIgnored() method to UserInteractionMonitor, XtabProvider,
and IStatelessNextEditProvider interface
- Add configurable ignoredScore (default: 0.9, near-accept)
- Skip ignored actions in debounce time calculation
This allows the happiness score algorithm to account for suggestions
that were shown but neither explicitly accepted nor rejected.
* feat(inlineEdits): update happiness score to v2 algorithm
Implement enhanced happiness score calculation with improved handling
of ignored/not-accepted actions:
Algorithm changes:
- Add ignored action limiting via window expansion to prevent score
dilution from long sequences of ignored suggestions
- Add normalized scoring (0-1 range based on accept/reject weights)
- Add configurable options: includeIgnored, ignoredLimit,
limitConsecutiveIgnored, limitTotalIgnored
Default value changes (tuned via experimentation):
- rejectedScore: 0 -> 0.2 (partial credit for explicit rejection)
- ignoredScore: 0.9 -> 0.5 (neutral treatment for ignored)
- highThreshold: 0.7 -> 0.6 (slightly easier to reach high aggressiveness)
New defaults enable total-ignored limiting (max 5 ignored actions in
the 10-action window) which allows the algorithm to look further back
in history to find meaningful accept/reject signals.
* Rename adaptive aggressiveness configuration
* feat(tests): add user happiness score tests to ensure new configurable algorithm behaves like original
* Keep more items than MAX_INTERACTIONS_CONSIDERED to account for dynamic window.
* Record ignore events to user interaction monitor
* Keep old behavior for timing; use a separate array to track events for aggressiveness level, including "ignored" events
* Only log events to interaction monitor if edit was shown and not superseded
* Add unit tests for happiness calculation and history logging
* Make default config equivalent to the original formula
* Make the unit test check the actual v2 implementation
* Fix test
* Log aggressiveness level and happiness score to XTabProvider log context
* Remove local files
* Remove extra line
* Doc
* Move validator to xtabPromptOptions
* Fix typo in configuration name
* Fix fallback to 0.5 calculation to use the correct denominator
* Catch and log validation errors, fallback to default
* Revert accidental change to default adaptive mode settings. Add validator for configured values. Remove default values from comments to avoid redundancy.
* Move lint options parsing function next to its validator
* Restore vscode settings
* Added a member variable to track if the last edit was shown instead of passing wasShown. Tested that only one suggestion is shown at a time, even with side-by-side editors of the same or different file (clicking away from the editor ignores the suggestion)
* Fix test
* use an enum instead of union of strings
* do not use `as any`
* fix reversed args
* migrate to using ActionKind enum and use TestLogService
---------
Co-authored-by: Ben Steenhoek <bensteenhoek@microsoft.com>
* check before enabling interleaved thinking
* fix: simplify Sonnet 4 model check in AnthropicPromptResolver
* fix: update hash check for hidden model G
Adds support for the 'vscode-chat-response-resource' scheme when checking
if a file is external and needs confirmation. This scheme is used for
chat response resources and should be treated similarly to untitled files
that don't require external file confirmation.
- Extends isFileExternalAndNeedsConfirmation to recognize the
vscode-chat-response-resource scheme
- Allows chat response resources to be accessed without confirmation
dialogs
Fixes https://github.com/microsoft/vscode/issues/292733
(Commit message generated by Copilot)
* Disable beta features for inline-chat in messages API usage
* Disable all beta features for non agent location
* Refactor: Update conversation agent checks to include MessagesProxy location
* Update Anthropic thinking budget to max output tokens
* Update test
* update telemetry for context editing with additional metrics
* fix: refine deferred loading logic for allowed conversation agents
* Remove 'experimental' tag from Messages API and budgetTokens descriptions in configuration
* Add Anthropic configuration options for Messages API and budget tokens
* Initial plan
* Use IFileSystemService instead of vscode.workspace.fs in trajectory export
Co-authored-by: zhichli <57812115+zhichli@users.noreply.github.com>
* Use subAgentInvocationId to determine agent name for trajectories
Changed the trajectory agent name logic to use subAgentInvocationId presence
instead of subAgentName fallback. Now uses 'subagent' when subAgentInvocationId
is defined, and 'GitHub Copilot Chat' for the main agent.
* Revert "Use subAgentInvocationId to determine agent name for trajectories"
This reverts commit d045a1de6fc25a8e9abebf08bfdb607d4c9014b9.
* docs: Clarify service preference over extension APIs in copilot-instructions
Added guidance to prefer internal services (IFileSystemService, ILogService)
over VS Code extension APIs, with reasoning for testability and cross-platform
support.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: zhichli <57812115+zhichli@users.noreply.github.com>
Co-authored-by: Zhichao Li <zhichli@microsoft.com>