Skip to content

Commit 2f0bfaa

Browse files
committed
fix: skip injection for first message after user for Anthropic providers
1 parent c115f5f commit 2f0bfaa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/messages/inject.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,12 @@ export const insertPruneToolContext = (
139139

140140
const userInfo = lastUserMessage.info as UserMessage
141141
const providerID = userInfo.model.providerID
142+
const modelID = userInfo.model.modelID
142143
const isGitHubCopilot =
143144
providerID === "github-copilot" || providerID === "github-copilot-enterprise"
145+
const isAnthropic = modelID.includes("claude")
144146

145-
if (isGitHubCopilot) {
147+
if (isGitHubCopilot || isAnthropic) {
146148
const lastMessage = messages[messages.length - 1]
147149
if (lastMessage?.info?.role === "user") {
148150
return

0 commit comments

Comments
 (0)