-
Notifications
You must be signed in to change notification settings - Fork 44.3k
agentHost: lean tools + CLI-parity prompt for HydraFusion #339165
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
Open
Aashna Garg (aashna)
wants to merge
2
commits into
main
Choose a base branch
from
aashna-hydrafusion-agent-host-cost-parity
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/vs/platform/agentHost/node/copilot/prompts/hydraFusionPrompt.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| /*--------------------------------------------------------------------------------------------- | ||
| * Copyright (c) Microsoft Corporation. All rights reserved. | ||
| * Licensed under the MIT License. See License.txt in the project root for license information. | ||
| *--------------------------------------------------------------------------------------------*/ | ||
|
|
||
| import type { SectionOverride, SystemMessageSection } from '@github/copilot-sdk'; | ||
| import { COPILOT_HYDRA_FUSION_MODEL_ID } from '../../../common/copilotCliConfig.js'; | ||
| import type { ModelSelection } from '../../../common/state/protocol/state.js'; | ||
| import { agentHostPromptRegistry, type IAgentHostPrompt } from './promptRegistry.js'; | ||
|
|
||
| const HYDRAFUSION_TONE = [ | ||
| '# Tone and style', | ||
| '* When providing output or explanation to the user, limit your response to 100 words or less.', | ||
| '* Be concise in routine responses. For complex tasks, briefly explain your approach before implementing.', | ||
| '* Prioritize brevity. Default to the shortest possible response that satisfies the request. Cut filler, recap, and process narration.', | ||
| ].join('\n'); | ||
|
|
||
| const HYDRAFUSION_TOOL_EFFICIENCY = [ | ||
| '# Search and delegation', | ||
| '* Give sub-agents comprehensive context; response-brevity rules do not apply to their prompts.', | ||
| '* Search files/text only in the cwd or its descendants unless absolutely necessary. For code, prefer: available code intelligence > available LSP > glob > grep with a glob > bash.', | ||
| '* For broad unfamiliar-code exploration, prefer `search_code_subagent`; use direct search tools for narrow lookups you can resolve in a couple of calls.', | ||
| '', | ||
| '# Tool usage efficiency', | ||
| 'CRITICAL: Maximize tool efficiency:', | ||
| '* For simple searches, reads, or edits requiring only 2-5 direct calls, use grep, glob, view, edit yourself; delegate only complex/long work that benefits from separate context, since sub-agents add latency.', | ||
| '* **USE PARALLEL TOOL CALLING** - when you need to perform multiple independent operations, make ALL tool calls in a SINGLE response. For example, if you need to read 3 files, make 3 view tool calls in one response, NOT 3 sequential responses.', | ||
| '* Chain related bash commands with && instead of separate calls', | ||
| '* Suppress verbose output (use --quiet, --no-pager, pipe to grep/head when appropriate)', | ||
| '* Batching does not replace investigation; take as many turns as needed to understand before acting.', | ||
| '* Default task agents to sync; use background only while doing independent work, not to poll while idle.', | ||
| ].join('\n'); | ||
|
|
||
| /** | ||
| * HydraFusion prompt: replaces the `tone` and `tool_efficiency` sections with | ||
| * the Copilot CLI's guidance so HydraFusion makes as few, as concise requests | ||
| * in the agent host as it does in the standalone CLI. Pairs with the lean | ||
| * default tool set (`HYDRAFUSION_DEFAULT_EXCLUDED_TOOLS`). | ||
| */ | ||
| class HydraFusionPromptResolver implements IAgentHostPrompt { | ||
| static readonly familyPrefixes: readonly string[] = []; | ||
|
|
||
| static matchesModel(model: ModelSelection): boolean { | ||
| return model.id === COPILOT_HYDRA_FUSION_MODEL_ID; | ||
| } | ||
|
|
||
| resolveSectionOverrides(): Partial<Record<SystemMessageSection, SectionOverride>> { | ||
| return { | ||
| tone: { action: 'replace', content: HYDRAFUSION_TONE }, | ||
| tool_efficiency: { action: 'replace', content: HYDRAFUSION_TOOL_EFFICIENCY }, | ||
| }; | ||
| } | ||
| } | ||
|
|
||
| agentHostPromptRegistry.registerPrompt(HydraFusionPromptResolver); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we turning these tools off? Feels like we're overfitting for evals here.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also tool search defers all of these tools. this will break scenarios in Agents window as well.