Skip to content

Commit 3b3de42

Browse files
authored
Merge pull request #252 from Opencode-DCP/fix/skip-github-copilot-user-role-injection
fix: skip synthetic message injection for GitHub Copilot when last message is user role
2 parents 5849833 + 1e0298b commit 3b3de42

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)