Skip to content

Cap opentelemetry-api below 1.46 in the openenv extra - #192

Merged
kelkalot merged 1 commit into
SimulaMet:devfrom
avalyset:fix/openenv-otel-logs-cap
Dec 4, 2026
Merged

kelkalot merged 1 commit into
SimulaMet:devfrom
avalyset:fix/openenv-otel-logs-cap

Conversation

@avalyset

@avalyset avalyset commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Caps opentelemetry-api below 1.46 in the openenv extra, so the OpenEnv server tests pass again in CI.

Cause

opentelemetry-api 1.46.0 was published on PyPI on 2026-12-04 at 17:20 UTC. In it, get_logger takes only the name positionally (opentelemetry/logs/_internal/__init__.py:500, type hints left out):

def get_logger(name, *, version=None, schema_url=None, attributes=None, logger_provider=None)

In 1.45.3 the version and the provider were positional. fastapi 0.165.1, the latest release, still passes them positionally in its request telemetry (fastapi/telemetry/_asgi.py:332, one line here):

logger=_logs.get_logger("fastapi", __version__, config["logger_provider"], schema_url=_SCHEMA_URL)

OpenEnv's server runs on FastAPI, so every WebSocket session fails with TypeError: get_logger() takes 1 positional argument but 3 positional arguments (and 1 keyword-only argument) were given. The client sees HTTP 500, and tests/test_openenv_target.py::test_server_sessions_one_at_a_time fails.

CI installs opentelemetry-api through anthropic (via any-llm-sdk) and fastapi (via openenv), with no upper bound, so every run that resolves dependencies after 17:20 UTC on 4 Dec gets 1.46.0. The last green runs started before 1.46.0 was published: dev on 3 Dec at 09:12 UTC, and an open PR on 4 Dec at 15:57 UTC, which installed 1.45.3. A run on 4 Dec at 18:19 UTC, with 1.46.0, failed in test (3.13) and full-test (3.11) on this test alone, with 4270 passed and 4273 passed beside it.

Fix

openenv = ["openenv>=0.10", "opentelemetry-api<1.46"] in pyproject.toml, with a comment that says why and when to drop the cap. The cap is in the openenv extra because the failing call comes from FastAPI, which that extra installs. Installs without the extra are unchanged. As of 4 Dec, no newer fastapi or opentelemetry-api release exists that this could point to instead.

Tests

With the extras the test job installs (.[dev,tracing,inspect,openenv]), Python 3.13:

  • Before, with opentelemetry-api 1.46.0: test_server_sessions_one_at_a_time: 1 failed, with the TypeError above.
  • After, with opentelemetry-api 1.45.3: 1 passed.
  • Full suite with the cap: 4269 passed, 6 skipped.
  • No Python files change, so there is nothing for ruff to check.

Drafted with Claude Opus 5.5 (Anthropic). The author made the methodological choices, had every figure checked against its source, and is responsible for the content.

opentelemetry-api 1.46.0, released on 4 Dec, made get_logger() take only the
name positionally. fastapi 0.165.1's request telemetry still passes the
version and provider positionally (fastapi/telemetry/_asgi.py:332), so the
OpenEnv server answers every WebSocket session with HTTP 500 and
test_server_sessions_one_at_a_time fails. Drop the cap once fastapi passes
them by keyword.
@kelkalot
kelkalot merged commit cd428b5 into SimulaMet:dev Dec 4, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants