You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make code-execution tools spawn-safe: CodeExecutionEntry / ExecutorToolEntry
The '_make_code_execution_tool.<locals>.execute_code' closure was the
single largest source of agent-e2e pickle failures under 'spawn' (14 of
20: suites 10/14/15 code-exec, stateful and skills paths all route
through it). Both factories now build picklable module-level entries:
- CodeExecutionEntry (code_execution_config): carries the executor by
value plus allowed_languages/allowed_commands/timeout as plain data;
the CommandValidator is rebuilt per call. Local/Docker/Serverless
executors hold no live resources and pickle cleanly; Jupyter pickles
pre-kernel only (documented).
- ExecutorToolEntry (code_executor.as_tool()): same pattern for the
public as_tool() API (examples 24, kitchen_sink).
- schema_from_function and the dispatch annotation resolver learn a
type(func).__call__ fallback so callable-instance tools keep real type
hints under `from __future__ import annotations` modules.
New tests: CodeExecutionEntry executes real code across a spawn
boundary; as_tool() entries pickle. tests/unit: 2512 passed, 1 skipped.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments