Skip to content

Add experimental context7 configuration for new workspace creation #374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2619,6 +2619,14 @@
],
"description": "%github.copilot.config.newWorkspaceCreation.enabled%"
},
"github.copilot.chat.newWorkspace.useContext7": {
"type": "boolean",
"default": false,
"tags": [
"experimental"
],
"description": "%github.copilot.config.newWorkspace.useContext7%"
},
"github.copilot.chat.agent.currentEditorContext.enabled": {
"type": "boolean",
"default": true,
Expand Down Expand Up @@ -3675,4 +3683,4 @@
"string_decoder": "npm:string_decoder@1.2.0",
"node-gyp": "npm:node-gyp@10.3.1"
}
}
}
1 change: 1 addition & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@
"github.copilot.tools.createAndRunTask.description": "Create and run a task in the workspace",
"github.copilot.tools.createAndRunTask.userDescription": "Create and run a task in the workspace",
"github.copilot.config.newWorkspaceCreation.enabled": "Whether to enable new agentic workspace creation.",
"github.copilot.config.newWorkspace.useContext7": "Whether to use the Context7 tools to scaffold project for new workspace creation.",
"github.copilot.config.editsNewNotebook.enabled": "Whether to enable the new notebook tool in Copilot Edits.",
"github.copilot.config.notebook.inlineEditAgent.enabled": "Enable agent-like behavior from the notebook inline chat widget.",
"github.copilot.config.summarizeAgentConversationHistory.enabled": "Whether to auto-summarize agent conversation history once the context window is filled.",
Expand Down
14 changes: 9 additions & 5 deletions src/extension/tools/node/newWorkspace/newWorkspaceTool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import * as l10n from '@vscode/l10n';
import { BasePromptElementProps, PromptElement, PromptElementProps, PromptSizing, TextChunk } from '@vscode/prompt-tsx';
import type { CancellationToken, LanguageModelToolInvocationOptions, LanguageModelToolInvocationPrepareOptions, PreparedToolInvocation, Uri } from 'vscode';
import { IRunCommandExecutionService } from '../../../../platform/commands/common/runCommandExecutionService';
import { ConfigKey, IConfigurationService } from '../../../../platform/configuration/common/configurationService';
import { IDialogService } from '../../../../platform/dialog/common/dialogService';
import { IVSCodeExtensionContext } from '../../../../platform/extContext/common/extensionContext';
import { IFileSystemService } from '../../../../platform/filesystem/common/fileSystemService';
Expand Down Expand Up @@ -123,7 +124,8 @@ export class NewWorkspaceCreationResult extends PromptElement<NewWorkspaceElemen
constructor(
props: PromptElementProps<NewWorkspaceElementProps>,
@IPromptPathRepresentationService private readonly promptPathRepresentationService: IPromptPathRepresentationService,
@IWorkspaceService private readonly workspaceService: IWorkspaceService
@IWorkspaceService private readonly workspaceService: IWorkspaceService,
@IConfigurationService private readonly configurationService: IConfigurationService
) {
super(props);
}
Expand All @@ -138,6 +140,10 @@ export class NewWorkspaceCreationResult extends PromptElement<NewWorkspaceElemen
</TextChunk>;
}

const useContext7 = this.configurationService.getConfig(ConfigKey.NewWorkspaceUseContext7);
const context7ToolInstructions = useContext7
? "Use get-library-docs and resolve-library-id to search documentation and identify the correct library for scaffolding the project"
: "If applicable, call project setup tool with:\n\t\t- projectType: e.g. 'python-script', 'mcp-server', 'next-js'\n\t\t- language: e.g. 'python', 'typescript'";
return <>
<TextChunk>
The user has opened the workspace folder {this.promptPathRepresentationService.getFilePath(workspaceUri)}<br />
Expand All @@ -157,10 +163,8 @@ export class NewWorkspaceCreationResult extends PromptElement<NewWorkspaceElemen
- Use this to guide project setup
- If already provided, skip this step

- [ ] Scaffold the Project Using the Right Tool**
- Call project setup tool with:
- projectType: e.g. 'python-script', 'mcp-server', 'next-js'
- language: e.g. 'python', 'typescript'
- [ ] Scaffold the Project**
${context7ToolInstructions}
- Run the scaffolding command from setup info
- Use '.' as the working directory
- Fall back to default scaffolding if needed
Expand Down
1 change: 1 addition & 0 deletions src/platform/configuration/common/configurationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ export namespace ConfigKey {
export const InlineEditsEnableDiagnosticsProvider = defineExpSetting<boolean>('nextEditSuggestions.fixes', { defaultValue: true, teamDefaultValue: true });
export const AgentCanRunTasks = defineValidatedSetting('chat.agent.runTasks', vBoolean(), true);
export const NewWorkspaceCreationAgentEnabled = defineSetting<boolean>('chat.newWorkspaceCreation.enabled', true);
export const NewWorkspaceUseContext7 = defineSetting<boolean>('chat.newWorkspace.useContext7', false);
export const SummarizeAgentConversationHistory = defineExpSetting<boolean>('chat.summarizeAgentConversationHistory.enabled', true);
export const VirtualTools = defineExpSetting<boolean>('chat.virtualTools.enabled', false);
export const CurrentEditorAgentContext = defineSetting<boolean>('chat.agent.currentEditorContext.enabled', true);
Expand Down