Skip to content

Commit a54675f

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

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/messages/inject.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,9 @@ export const insertPruneToolContext = (
141141
const providerID = userInfo.model.providerID
142142
const isGitHubCopilot =
143143
providerID === "github-copilot" || providerID === "github-copilot-enterprise"
144+
const isAnthropic = providerID === "anthropic" || providerID === "google-vertex-anthropic"
144145

145-
if (isGitHubCopilot) {
146+
if (isGitHubCopilot || isAnthropic) {
146147
const lastMessage = messages[messages.length - 1]
147148
if (lastMessage?.info?.role === "user") {
148149
return

0 commit comments

Comments
 (0)