feat(provider/anthropic): add code_execution_20250825 tool#9435
Merged
lgrammel merged 38 commits intovercel:mainfrom Oct 14, 2025
Merged
feat(provider/anthropic): add code_execution_20250825 tool#9435lgrammel merged 38 commits intovercel:mainfrom
lgrammel merged 38 commits intovercel:mainfrom
Conversation
…enhanced Bash support and add new result types for text editor and Bash execution
Contributor
Author
|
to close issue #9433 |
Contributor
Author
|
@gr2m this is my first PR on this repo, can I get some feedback & tips on anything I can do to get things merged quicker? |
lgrammel
reviewed
Oct 14, 2025
lgrammel
reviewed
Oct 14, 2025
Collaborator
|
@ellispinsky I'll take it from here, thanks for the pr. |
Collaborator
Collaborator
|
This is way more complex. The tool input/output processing needs to be rewritten and we need to distinguish between the old and the new tool version. |
Collaborator
|
more changes planned, pls do not make any commits |
lgrammel
approved these changes
Oct 14, 2025
Contributor
|
|
5 tasks
lgrammel
added a commit
that referenced
this pull request
Oct 23, 2025
… code-execution-20250825 to download output files (#9669) ## Background The Anthropic code execution bash tool provides a list of the generated files. This feature was missing from #9435 (although present in the zod schemas). It enables downloading generated files from the Anthropic API. ## Summary - add response property `file_id `in code-execution-20250825 - add example downloading file. ## Example Use code execution to have the AI create an Excel file. Get the executed python code.  prompt: `Write a Python script to calculate fibonacci number and then execute it to find the 10th fibonacci number finally output data to excel file and python code.` ## Manual Verification ### package/anthropic - packages/anthropic/src/anthropic-messages-language-model.test.ts - add fixtures `anthropic-code-execution-20250825.2` for file_id return pattern. - check the snapshot and file_id was included in the result. ### examples/ai-core - add the examples, src/stream-text/anthropic-code-execution-20250825-downloads.ts - add the examples, src/generate-text/anthropic-code-execution-20250825-downloads.ts ### examples/next-openai - fix /components/tool/anthropic-code-execution-view.tsx (add a download button) - add route for submit native download api and provide files. /app/api/code-execution-files/anthropic/[file]/route.ts ## Checklist - [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] Formatting issues have been fixed (run `pnpm prettier-fix` in the project root) - [x] I have reviewed this pull request (self-review) ## Related Issues Fixes gap from #9435 --------- Co-authored-by: tsuzaki430 <tsuzaki430@users.noreply.github.com> Co-authored-by: Lars Grammel <lars.grammel@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Background
Anthropic has released a new tool
code_execution_20250825.Summary
Added Anthropic code execution tool 20250825 with enhanced bash and text editing support.
Manual Verification
pnpm tsx src/generate-text/anthropic-code-execution-latest.tsand confirmed the tool worked.pnpm tsx src/stream-text/anthropic-code-execution-latest.tsand confirmed the tool worked.Tasks
Future Work
Related Issues
closes #9433