SIGN IN SIGN UP

fix(workflow): preserve tool metadata across steps (#18163)

## Background

`WorkflowAgent` serializes tools before invoking the model in a workflow
step. The existing projection dropped function-tool `inputExamples` and
tool-level `providerOptions`, so providers could not receive metadata
such as Anthropic `input_examples` or cache-control settings.

## Summary

- preserve `inputExamples` and `providerOptions` in serializable tool
definitions
- restore both fields when reconstructing function tools and preserve
`providerOptions` for provider tools
- add round-trip regression coverage and a patch changeset for
`@ai-sdk/workflow`

## Contributor Credit

Issue report, reproduction, and implementation: @graemestanding-dd.

## End-to-End Verification

Passed a function tool containing input examples and Anthropic
cache-control options through the same `serializeToolSet` →
`resolveSerializableTools` boundary used by `WorkflowAgent`. The
reconstructed tool retained both fields before provider preparation. The
complete `@ai-sdk/workflow` Node and Edge suites also passed: 162 tests
in each environment.

## Checklist

- [x] All commits are signed (PRs with unsigned commits cannot be
merged)
- [x] Tests have been added / updated (for bug fixes / features)
- [ ] Documentation has been added / updated (for bug fixes / features)
- [x] A _patch_ changeset for relevant packages has been added (for bug
fixes / features - run `pnpm changeset` in the project root)
- [x] I have reviewed this pull request (self-review)

## Related Issues

Fixes #18160
G
Graeme Standing committed
e21bde74c64351453ac82abeae07e00fe838ee9a
Parent: 0651c5f
Committed by GitHub <noreply@github.com> on 8/25/2026, 5:11:51 AM