Skip to content

Commit 1e0298b

Browse files
committed
fix: skip synthetic message injection for GitHub Copilot when last message is user role
1 parent 5849833 commit 1e0298b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/messages/inject.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,13 @@ export const insertPruneToolContext = (
143143
const isGitHubCopilot =
144144
providerID === "github-copilot" || providerID === "github-copilot-enterprise"
145145

146+
if (isGitHubCopilot) {
147+
const lastMessage = messages[messages.length - 1]
148+
if (lastMessage?.info?.role === "user") {
149+
return
150+
}
151+
}
152+
146153
logger.info("Injecting prunable-tools list", {
147154
providerID,
148155
isGitHubCopilot,

0 commit comments

Comments
 (0)