#6593·ogx

Lift the `openai <2.44` cap once the API recorder is fixed for openai ≥ 2.44

Author: mattfCreated Sep 19, 2026Updated Sep 19, 2026
Labelsdependenciestech-debt

What is the technical debt you think should be addressed?

We currently pin openai>=2.41.0,<2.44 in pyproject.toml (added while unblocking dependabot PR #6587). That cap is not a real openai compatibility constraint — it works around a bug in our own test-recording infrastructure, and it has started driving unrelated dependency pins.

Mechanism: src/ogx/testing/api_recorder.py (patch_httpx_for_test_id, invoked from tests/integration/conftest.py) wraps OgxClient._prepare_request and, inside the wrapper, calls openai.OpenAI._prepare_request(self, request) with the generated OgxClient instance as self (lines ~325, 333-335, 359). That is only safe while openai's _prepare_request doesn't touch attributes a real openai.OpenAI sets in __init__. In openai 2.44.0, _prepare_request began dereferencing self._provider_runtime (an __init__-set attribute), so calling it on an OgxClient raises AttributeError: 'OgxClient' object has no attribute '_provider_runtime', which fails every recorded integration test.

Because the cap is <2.44, it also dragged in a second pin: langchain-openai is capped at >=1.2.2,<1.3 since 1.6.2 requires openai>=2.45.0. One internal test bug is therefore currently holding back two dependency lines, and the openai cap will keep blocking future dependabot bumps until it's addressed.

What is the benefit of addressing this technical debt?

  • Restores the ability to track the latest openai (and, transitively, langchain-openai) without a version ceiling, so dependabot python-deps PRs stop needing manual reverts.
  • Keeps the integration recording infra correct for current and future openai clients.
  • Removes a "magic" version cap that isn't self-explanatory without this issue for context.

Other thoughts

  • The root fix belongs in src/ogx/testing/api_recorder.py, not the dependency pin — the recorder should not call OpenAI._prepare_request on a non-OpenAI self. Options:
    1. Drop the openai_orig(self, request) delegation entirely if OgxClient._prepare_request already does what's needed (confirm why the openai call was added first).
    2. If the openai behavior is required, replicate the specific request mutations (headers / auth) directly rather than invoking the bound method, so we don't depend on openai's private instance state.
    3. At minimum, guard the call so it can't dereference attributes absent on OgxClient.
  • Once the recorder is verified against openai ≥ 2.44, remove both caps in a single PR and re-record any integration tests whose request bodies changed.
  • Could be a good first issue once the intended behavior of the openai_orig call is documented.