Luc Gagan
Luc Gagan
400 anthropic error: messages.2: the following `tool_use` ids were not found in `tool_result` blocks
Indeed. This part is the broken part: https://github.com/lucgagan/gateway/blob/4f92b0f8d1aa6d233c8892291885e1be03e71766/src/providers/anthropic/chatComplete.ts#L170 It should be something like this instead: ```ts const lastMessage = messages[messages.length - 1]; if (lastMessage.role === 'user' && lastMessage.content?.[0]?.type === 'tool_result')...
400 anthropic error: messages.2: the following `tool_use` ids were not found in `tool_result` blocks
> Indeed. This part is the broken part: > > https://github.com/lucgagan/gateway/blob/4f92b0f8d1aa6d233c8892291885e1be03e71766/src/providers/anthropic/chatComplete.ts#L170 > > It should be something like this instead: > > const lastMessage = messages[messages.length - 1]; > >...
400 anthropic error: messages.2: the following `tool_use` ids were not found in `tool_result` blocks
@VisargD is anyone using this project? This seems like a major major issue that is just being completely ignored.
400 anthropic error: messages.2: the following `tool_use` ids were not found in `tool_result` blocks
^ That's failing with Claude 3.7 It is giving the error I shared: > 400 anthropic error: messages.2: the following tool_use ids were not found in tool_result blocks
400 anthropic error: messages.2: the following `tool_use` ids were not found in `tool_result` blocks
Very surprised that others are not flagging this as an issue. Still have to re-apply the patch every time I upgrade gateway.
400 anthropic error: messages.2: the following `tool_use` ids were not found in `tool_result` blocks
Looks like ordering of conditions has changed. Just sharing an updated patch: ```diff --- a/src/providers/anthropic/chatComplete.ts +++ b/src/providers/anthropic/chatComplete.ts @@ -270,8 +270,23 @@ export const AnthropicChatCompleteConfig: ProviderConfig = { if (msg.role ===...
400 anthropic error: messages.2: the following `tool_use` ids were not found in `tool_result` blocks
> [@lucgagan](https://github.com/lucgagan) Would you mind sharing a sample request & response? I am not sure what's the best way to "catch this". I've added a log statement and will keep...
@stephenjason89 Any chance you could contribute this to https://github.com/un-ts/eslint-plugin-import-x instead? If you look at the open PRs on this project, this PR has low chance of getting prioritized.