Skip to content

Conversation

@Alain00
Copy link
Contributor

@Alain00 Alain00 commented Nov 28, 2025

The current implementation slices the message history after converting entries into ModelMessage. When this happens, a tool-call or tool-result message may be trimmed out of the array. This can orphan a tool-result, triggering the error:

No tool call found for function call output.

Solution

Slice the message history before converting items to ModelMessage, ensuring the resulting ModelMessage array remains intact and preserves the call/result pairing.

@vercel
Copy link

vercel bot commented Nov 28, 2025

@Alain00 is attempting to deploy a commit to the Pontus Abrahamsson's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Alain00 Alain00 changed the title fix: no function tool call found fix(agent): no function tool call found Nov 28, 2025
@Alain00
Copy link
Contributor Author

Alain00 commented Nov 28, 2025

@pontusab I'm running into this error quite a bit in production-like flows. Hoping you can take a quick look at this PR when you have a chance

@Alain00 Alain00 changed the title fix(agent): no function tool call found fix(agent): no tool call found for function call output Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant