feat: tool_code_execution() — provider-executed code execution
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- python
- Domain
- ai, backend-api-design
Research direction
Start with the docs/plans draft and the existing web search/fetch implementation described in the issue. Trace the provider annotation and content-type precedents, then define the work needed for Anthropic, OpenAI Responses, and Google, including container persistence and unsupported platforms; done means the design is settled and all three providers have a consistent first-class tool path.
Written by the indexing model from the issue text.
Description
Code execution is the last provider-executed tool that is GA across all three first-class providers (Anthropic, OpenAI Responses API, Google Gemini) — the same footprint as tool_web_search(). A first-class tool_code_execution() would let the model run Python server-side for data analysis, math, and file processing with zero local sandbox setup, which is squarely in the wheelhouse of chatlas's data-science audience.
chat.register_tool(tool_code_execution())
chat.chat("Compute the eigenvalues of this matrix and plot them: ...")
Provider mapping
| Provider | Tool spec | Notes |
|---|---|---|
| Anthropic | {"type": "code_execution_20250825", ...} (newer dated variants exist) |
Server sandbox (Python 3.11, no internet). Container reusable across requests via container param. Free when combined with recent web search/fetch variants; otherwise ~1,550 free container-hours/org/month, then $0.05/hr. Docs |
| OpenAI (Responses) | {"type": "code_interpreter", "container": {"type": "auto"}} |
Or an explicit container ID from /v1/containers. Billed per memory tier per 20-min session ($0.03–$1.92). Docs |
types.Tool(code_execution=types.ToolCodeExecution()) |
No extra fee (standard token billing). Python only, ~30s per execution, no custom packages. Returns executable_code / code_execution_result parts. Docs |
Design considerations
- New content types (
ContentToolRequestCodeExecution/ContentToolResponseCodeExecution) following the web search/fetch precedent, registered inPROVIDER_ANNOTATION_TYPESso each provider replays only its own blocks. - Container/session persistence across turns (Anthropic
container, OpenAI container IDs) — likely: scan turn history for the most recent container ID and resend it. - Gemini models before Gemini 3 cannot mix built-in tools with custom function declarations in the same request.
- Availability gaps: not supported on Amazon Bedrock; not supported on Vertex AI for Anthropic models (see the guard issue for how unsupported platforms should fail).
Design work for this is already underway locally (docs/plans draft + worktree).
- Dominant language
- Python
- Stars
- 179
- Forks
- 32
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 10
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from posit-dev/chatlas
-
A streaming text delta that repeats everything streamed so far is missing from the recorded turnPossibly taken @cpsievert claimed this 81 days ago. Openai-triage:done Priority: Medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
ai-triage:needs-review documentation
Difficulty 2/5 1-2 days Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 1-2 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
ai-triage:done Priority: Low
Difficulty 3/5 1-2 days Newbie friendliness 55/100
Maintainers usually reply within 1 day
All issues in posit-dev/chatlas
Similar issues
-
jira: an unquoted JQL number of more than 4300 digits is a plain-text 500, where real answers 200Openfidelity
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
A JSON chat answer blocks the backend event loop for the whole RAG runPossibly taken @NopeCharon claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
The-OpenROAD-Project/ORAssistant#656 ·
Maintainers usually reply within 1 day
-
bug(operator): VolterraOperator built inside jax.jit with a concrete decay raises TracerBoolConversionErrorPossibly taken @jejjohnson claimed this today. Opentype:bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
jejjohnson/integrix#144 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
finos/ai-governance-framework#459 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
autowarefoundation/autoware_carla_scenario#2963 ·
Maintainers usually reply within 1 day