Publish `RenderSandbox` fields in the agent spec schema
The agent spec JSON schema lists no fields for RenderSandbox. It only offers the bare name, so a validator or editor using the schema rejects a spec that sets working_dir, even though that spec loads and runs. Generating the schema on main showed this.
The cause is its client field. It imports the client type at runtime, so the __init__ hints resolve, but Pydantic cannot produce a JSON schema for that class, so the form with the fields is left out.
OpenSandbox and ModalSandbox avoid this with an explicit from_spec, as the AbstractCapability.from_spec docstring recommends, and #12500 does the same for E2BSandbox. This adds one here:
- It lists the capability's fields except
client, as a client isn't data. Python code still passesclientto the constructor. defer_loadingstays in the signature, so a spec that sets it tofalsestill loads.- A spec that sets
clientis now refused when it loads, instead of being accepted.
Testing: one test checks the fields in the schema and another that from_spec forwards them. I ran only these locally, and CI covers the rest.
Checklist
- No breaking changes in accordance with the version policy.
- PR title is fit for the release changelog.
š¤ Generated with Claude Code
Summary by cubic
Adds an explicit from_spec to RenderSandbox so the agent spec JSON schema lists its fields ā working_dir, env, sandbox_timeout, and so on ā instead of only the bare capability name, which caused validators to reject valid specs.
- A spec that sets
clientis now refused when it loads, instead of being silently accepted; Python code still passesclientto the constructor. defer_loadingstays in the signature, so specs that set it tofalsestill load.