Repository navigation
Install every Python Bot from a hashed lockfile - #2950
Merged
Merged
Conversation
opentelemetry-api 1.46.0 came out on PyPI at 17:20 UTC on 2026-12-04. FastAPI 0.165's built-in telemetry calls its logs API the old way (fastapi/telemetry/_asgi.py: "get_logger() takes 1 positional argument but 3 ... were given"), so every request to a Python Bot answered 500. Each Bot's requirements.txt named fastapi without a version, and the images and CI resolved them afresh, so every image or CI run after that minute was broken without a change of ours. Each Python Bot now names what it asks for in requirements.in. requirements.txt is that file compiled by uv (scripts/python-locks.sh), every package at one version with its sha256 hashes, for Linux on amd64 and arm64 and for macOS. The Dockerfiles and the harness tests install only the lock, with `pip install --require-hashes --no-deps`. The tests' packages are compiled against the Bot's own lock, so they run on what the image ships. The locks are compiled against PyPI as of 2026-12-04 17:00 UTC, so opentelemetry-api stays on 1.45.3. scripts/python-locks.test.ts fails when an image or a workflow installs outside a hashed lock, or when a lock is missing a package its requirements.in asks for. The model lock reads its pins from requirements.in.
davidmckayv
requested review from
MikeRyanDev,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
December 4, 2026 17:43
Its README runs it with uv run --frozen, so it starts on the versions it was checked with rather than whatever PyPI released that day, and the lock test holds every Python example to a uv.lock.
Contributor
Author
|
Two notes that came after the description was written:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every Python Bot now installs from a hashed lockfile, so a package PyPI releases can no longer break an image or a CI run without a change of ours.
What happened
opentelemetry-api 1.46.0 was published to PyPI at 2026-12-04 17:20:17 UTC. FastAPI 0.165's built-in telemetry calls the old logs API, so under 1.46.0 every request to a FastAPI app fails:
Every Python Bot's
requirements.txtnamedfastapiwith no version. The images (pip install -r requirements.txt) and CI resolved them afresh on every build, so anything built after 17:20 got 1.46.0. Its/healthanswered 500 and the Bot never came up. CI that runs the LangGraph harness started failing on every head at about that time.Reproduced locally on
agent-langgraph-agui:Upstream has no fix yet: no opentelemetry-api 1.46.1, no newer FastAPI, and no issue filed. The nearest upstream item is open-telemetry/opentelemetry-python#5996 ("make Logs SDK interfaces forward-compatible before 1.46.0").
The same class of break has already hit us at least four times: litellm 1.106.0, google-genai 3.0.0, anthropic 2.0.0 and langchain-anthropic 1.7.11. Each time a cap was added after the fact. This change fixes the class, not the one package.
Exposure
scripts/start.shand plaindocker compose up, wherepull_policy: buildis the default. It also covers any image built from main after 17:20.What the leaders do
Repeatable installs come from a lockfile installed exactly, never from a fresh resolve:
--require-hashesand--no-depsso nothing unchecked is fetched. https://pip.pypa.io/en/stable/topics/secure-installs/requirements.into a pinnedrequirements.txt. A pinned dependency is not upgraded on the next compile unless--upgradeor--upgrade-packageasks for it. https://docs.astral.sh/uv/pip/compile/ and https://pip-tools.readthedocs.io/bun install --frozen-lockfile), and so does the TypeScript LangGraph engine (npm ci). The Python Bots were the last images still built from ranges.What changed
agent-*/requirements.in: what each Bot asks for. This is the oldrequirements.txt, unchanged, with every hold-back comment kept.agent-*/requirements.txt: the lock, compiled byscripts/python-locks.sh. Every package is at one version with its sha256 hashes, resolved for every platform (--universal: Linux amd64 and arm64 for the images, macOS for development) at Python 3.12. The locks were compiled against PyPI as of 2026-12-04 17:00 UTC, so they hold the versions from just before the break (opentelemetry-api 1.45.3, fastapi 0.165.1).agent-*/requirements-test.inandrequirements-test.txt: test packages compiled with-c requirements.txt, so the tests run on exactly what the image ships. The test files used to pinhttpx==0.28.1, which most images didn't ship (they shipped 0.29.0). httpx and langroid's pytest now come from the Bot's own lock.python harnessCI job:pip install --require-hashes --no-deps -r requirements.txt(plusrequirements-test.txtin CI).scripts/python-locks.sh: compiles one Bot's lock or all of them. A compile keeps the existing versions, andUPGRADE=1moves everything forward. By default nothing newer than 3 days is taken, the same agerenovate.jsonwaits for npm;EXCLUDE_NEWERoverrides it.scripts/model-compat.tsandscripts/model-lock.test.tsread the deliberate pins fromrequirements.in, so their meaning doesn't change.model-lock.ymlalso triggers onrequirements.in.docs/releasing.md: a new "Python lockfiles" section on how to change a package and how to move a lock forward.Tests
scripts/python-locks.test.tsfails when:pip installwithout--require-hashes --no-deps;Red/green: on main, 3 of its 4 tests fail (unhashed
requirements.txt, norequirements.in,agent-adk/Dockerfile:9installs without--require-hashes). On this branch all 4 pass.model-lock.test.ts,model-compat.test.tsandci-changes.test.tspass. Format, lint and typecheck are clean.Changelog
Bots.
scripts/start.shanddocker compose upbuild from a checkout. Each Python Bot's image now installs from a lockfile with every package's version and hash, so a new upstream release reaches an image only when we update the lock. Released images, OpenBot Desktop and OpenBot Cloud were not affected.