Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 8, 2025

This PR implements the isReadOnly capability for chat sessions, allowing extensions to specify whether a chat session should be in read-only mode. The capability defaults to false to maintain backward compatibility.

Changes

API Changes

  • Added isReadOnly?: boolean property to the ChatSessionCapabilities interface in the proposed API
  • The property is optional and defaults to false when not specified

Implementation

The capability flows through the system following the same pattern as existing capabilities like supportsInterruptions:

  1. Extension Point Schema: Updated the chatSessions contribution point to accept the isReadOnly capability in package.json
  2. Type Definitions: Added the property to all relevant interfaces and DTOs throughout the extension host system
  3. Data Flow: The capability is passed from the extension's API through the extension host to the main thread

Usage Example

Extensions can now specify read-only chat sessions in their package.json:

{
  "contributes": {
    "chatSessions": [{
      "type": "myExtension.readOnlySession",
      "name": "@readonly",
      "displayName": "Read-only Session",
      "description": "A session that cannot accept new input",
      "capabilities": {
        "isReadOnly": true
      }
    }]
  }
}

Or programmatically when registering content providers:

vscode.chat.registerChatSessionContentProvider(
  'mySessionType', 
  provider, 
  { isReadOnly: true }
);

Testing

  • Added comprehensive test coverage for the new capability
  • Updated existing tests to handle the new property
  • Validated TypeScript compilation across all modified files

The implementation follows VS Code's established patterns for chat session capabilities and maintains full backward compatibility.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • electronjs.org

If you need me to access, download, or install something from one of these locations, you can either:

Created from VS Code via the GitHub Pull Request extension.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] Implementation of isReadOnly Capability in Chat Sessions Add isReadOnly capability to chat sessions Sep 8, 2025
@Copilot Copilot AI requested a review from joshspicer September 8, 2025 02:41
Copilot finished work on behalf of joshspicer September 8, 2025 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants