Commit Graph

9 Commits

Author SHA1 Message Date
Ulugbek Abdullaev eed28ec3a1 Revert "request logger debug view grouping and ordering (#3019)" (#3114)
This reverts commit 3616847b8d.
2026-01-23 13:40:31 +00:00
Connor Peet ba56721dfa tools: add support for model-specific tool registration (#2857)
* tools: add support for model-specific tool registration

This PR goes with https://github.com/microsoft/vscode/pull/287666

This allows the registration of tools that are scoped to specific
language models. These tools can be registered at runtime with
definitions derived from e.g. the server.

I think we should adopt this and go away from the current
`alternativeDefinitions` pattern which we have used previously.

Example of having tools specific for GPT 4.1 vs 4o:

```ts
ToolRegistry.registerModelSpecificTool(
	{
		name: 'gpt41_get_time',
		inputSchema: {},
		description: 'Get the current date and time (4.1)',
		displayName: 'Get Time (GPT 4.1)',
		toolReferenceName: 'get_time',
		source: undefined,
		tags: [],
		models: [{ id: 'gpt-4.1' }],
	},
	class implements ICopilotTool<unknown> {
		invoke() {
			return new vscode.LanguageModelToolResult([new vscode.LanguageModelTextPart('Current year is 2041 (GPT 4.1)')]);
		}
	}
);

ToolRegistry.registerModelSpecificTool(
	{
		name: 'gpt4o_get_time',
		inputSchema: {},
		description: 'Get the current date and time (4o)',
		displayName: 'Get Time (GPT 4o)',
		toolReferenceName: 'get_time',
		source: undefined,
		tags: [],
		models: [{ id: 'gpt-4o' }],
	},
	class implements ICopilotTool<unknown> {
		invoke() {
			return new vscode.LanguageModelToolResult([new vscode.LanguageModelTextPart('Current year is 2040 (GPT 4o)')]);
		}
	}
);
```

* demo

* fix

* overrides

* add overridesTool

* fix inverted logic

* test fixes and back compat

* make memory tool model specific

* fix tests and contribute memory to the vscode toolset

* verison

* fix unit tests

* rm config

* fix missing askquestions

---------

Co-authored-by: bhavyaus <bhavyau@microsoft.com>
2026-01-22 18:34:05 +00:00
Aaron Munger 3616847b8d request logger debug view grouping and ordering (#3019)
* Add hierarchical token support for request logger grouping

* chronological ordering, pr feedback

* revert subagent as child, not working

* Revert subagent hierarchy features from CapturingToken

Remove parentToken, createChild(), getRoot(), isDescendantOf() and currentToken
since tool invocation happens outside the parent's captureInvocation() context,
making AsyncLocalStorage-based context propagation infeasible.

Updated docs with Future Improvements section describing potential solutions.

* clean up tests

* perf feedback
2026-01-21 18:44:14 +00:00
Ulugbek Abdullaev 9d043e2602 nes: feat: stest creator (#2982)
* feat: add NES expected edit capture feature

Add functionality to capture expected edits when NES suggestions are rejected:
- Add ExpectedEditCaptureController for managing capture sessions
- Add configuration settings for enabling the feature
- Register capture commands with keybindings
- Add context key for inlineEditsEnabled to enable keybindings
- Include documentation for the feature

* Revert debug recorder to original settings

* feat: add tests for filtering sensitive files in inline edit logs

- Implemented unit tests to ensure sensitive files such as .env files, private keys, and files in sensitive directories are filtered out correctly from logs.
- Added handling for Windows-style backslash paths in the filtering function.
- Preserved non-document log entries during filtering.

feat: add NesFeedbackSubmitter tests

- Created comprehensive tests for the NesFeedbackSubmitter class, covering methods for extracting document paths and filtering recordings by excluded paths.
- Ensured proper handling of metadata files and invalid JSON scenarios.
- Included performance tests for filtering large recordings efficiently.

fix: enhance inline completion provider with document path metadata

- Updated inline completion provider to include document path in metadata during rejection captures.

feat: add command for submitting expected edits in inline edit provider feature

- Registered a new command to allow submission of captured edits in the inline edit provider feature.

* refactor: update GitHub session retrieval method and adjust test expectations for performance

* test: update inlineEditDebugComponent tests for consistent string quoting

* feat: enhance sensitive file filtering with case-insensitive matching and additional patterns

* feat: add User-Agent header to GitHub API requests in NesFeedbackSubmitter

* Move NES Expected Edit Capture documentation

* fix compilation

* move spec to docs/

* simplify by not having `| undefiend`

* nicer tracing

* remove redundancy

* migrate to sublogger

* web-compat Buffer

* reuse code

* correct composition of edits

* use cmd+enter to save the captured edits

---------

Co-authored-by: Erik Portillo <6964428+erikportillo@users.noreply.github.com>
2026-01-20 17:30:49 +00:00
Rob Lourens ccbc4b9bb7 Tweak to tools.md (#2988) 2026-01-19 19:16:57 +00:00
Rob Lourens 04b6016192 Gpt prompt cleanups (#2020)
* Refactor agent prompt tests

* Gpt prompt cleanups
Includes switching the gpt-5.1-codex-mini prompt to use the codex prompt
2025-11-15 00:03:09 +00:00
Bhavya U 237bb568c9 Add authoring guide for model-specific prompts (#1625)
* Add authoring guide for model-specific prompts

* Update docs/prompts.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update docs/prompts.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update docs/prompts.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-26 03:36:50 +00:00
Rob Lourens 0893eaecfd Rename executePrompt to runSubagent (#1420) 2025-10-19 21:52:40 +00:00
Rob Lourens 91fe4863d3 Add doc about implementing tools (#146)
* Add doc about implementing tools
Ported from old wiki and updated

* A couple more notes
2025-07-07 22:09:41 +00:00