File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 77 extractParameterKey ,
88 buildToolIdList ,
99 createSyntheticAssistantMessageWithToolPart ,
10+ createSyntheticUserMessage ,
1011} from "./utils"
1112import { getFilePathFromParameters , isProtectedFilePath } from "../protected-file-patterns"
1213import { getLastUserMessage } from "../shared-utils"
@@ -136,7 +137,17 @@ export const insertPruneToolContext = (
136137 if ( ! lastUserMessage ) {
137138 return
138139 }
139- messages . push (
140- createSyntheticAssistantMessageWithToolPart ( lastUserMessage , prunableToolsContent ) ,
141- )
140+
141+ const userInfo = lastUserMessage . info as UserMessage
142+ const providerID = userInfo . model . providerID
143+ const isGitHubCopilot =
144+ providerID === "github-copilot" || providerID === "github-copilot-enterprise"
145+
146+ if ( isGitHubCopilot ) {
147+ messages . push (
148+ createSyntheticAssistantMessageWithToolPart ( lastUserMessage , prunableToolsContent ) ,
149+ )
150+ } else {
151+ messages . push ( createSyntheticUserMessage ( lastUserMessage , prunableToolsContent ) )
152+ }
142153}
You can’t perform that action at this time.
0 commit comments