Skip to content

Conversation

@TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented Jan 28, 2026

This way you can use your Copilot Subscription with the Claude Code CLI.

fixes microsoft/vscode#291384

…ilot endpoints

This way you can use your Copilot Subscription with the Claude Code CLI.
Copilot AI review requested due to automatic review settings January 28, 2026 19:22
@TylerLeonhardt TylerLeonhardt self-assigned this Jan 28, 2026
@vs-code-engineering vs-code-engineering bot added this to the January 2026 milestone Jan 28, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds a /terminal slash command to the Claude Agent that launches Claude's CLI configured to use GitHub Copilot endpoints. This allows users to leverage their Copilot subscription with the Claude Code CLI in a terminal environment.

Changes:

  • Adds a new slash command (/terminal) that creates a terminal session with Claude CLI configured to proxy through Copilot Chat endpoints
  • Extends the ClaudeLanguageModelServer to support both x-api-key and Authorization Bearer token authentication
  • Updates documentation to reflect the new command

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
src/extension/agents/claude/vscode-node/slashCommands/terminalCommand.ts Implements the terminal slash command handler with CLI detection and server configuration
src/extension/agents/claude/vscode-node/slashCommands/test/terminalCommand.spec.ts Comprehensive test suite for the terminal command covering CLI detection, terminal creation, and error handling
src/extension/agents/claude/vscode-node/slashCommands/index.ts Registers the new terminal command in the slash commands index
src/extension/agents/claude/node/claudeLanguageModelServer.ts Adds support for Authorization Bearer token authentication in addition to x-api-key
src/extension/agents/claude/AGENTS.md Updates documentation to list the new /terminal command
package.json Registers the command in VS Code contributions and chat session commands
package.nls.json Adds localization string for the command title
Comments suppressed due to low confidence (1)

src/extension/agents/claude/vscode-node/slashCommands/test/terminalCommand.spec.ts:237

  • There's no test coverage for error handling when the stream is undefined (Command Palette invocation). The implementation has a code path at lines 105-106 that uses vscode.window.showErrorMessage for errors when stream is undefined, but this scenario is not tested. Add a test to ensure error messages are shown correctly when invoked from the Command Palette and an error occurs.
		it('logs errors when terminal creation fails', async () => {
			// Make createTerminal throw an error
			testTerminalService.createTerminalSpy.mockImplementation(() => {
				throw new Error('Failed to create terminal');
			});

			const mockStream = new MockChatResponseStream();
			const errorSpy = vi.spyOn(mockLogService, 'error');

			await terminalCommand.handle('', mockStream, CancellationToken.None);

			expect(errorSpy).toHaveBeenCalled();
		});

Comment on lines +145 to +152
private async _getLanguageModelServer(): Promise<ClaudeLanguageModelServer> {
if (!this._langModelServer) {
this._langModelServer = this.instantiationService.createInstance(ClaudeLanguageModelServer);
await this._langModelServer.start();
}

return this._langModelServer;
}
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TerminalSlashCommand creates a ClaudeLanguageModelServer instance that extends Disposable but never disposes of it. The server starts an HTTP server that should be properly disposed when no longer needed. Consider making TerminalSlashCommand extend Disposable and register the server for disposal, or dispose of it when appropriate (e.g., when the extension is deactivated).

Copilot uses AI. Check for mistakes.
@TylerLeonhardt TylerLeonhardt added this pull request to the merge queue Jan 28, 2026
Merged via the queue into main with commit 1c697b9 Jan 28, 2026
25 checks passed
@TylerLeonhardt TylerLeonhardt deleted the tyler/implicit-chinchilla branch January 28, 2026 19:48
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.

[Claude Agent] Add a /terminal command that will launch Claude's CLI but using Copilot endpoints

3 participants