Skip to content

v0.3.0 — install() actually works

Choose a tag to compare

@RAJUSHANIGARAPU RAJUSHANIGARAPU released this 02 Sep 08:45
· 1 commit to main since this release
b60b44b

If you have 0.1.0 installed, upgrade — the previous release could not start.

pip install -U agentlens-tracer

The headline

agent_lens.install() — the documented one-line entry point — raised
AttributeError on any environment with the OpenAI SDK installed. It patched
Completions.acreate, an attribute no openai >=1.0 has ever defined, and it
patches OpenAI first, so it failed before reaching Anthropic. That shipped in
0.1.0 and has been broken since 2026-05-02.

Also fixed

  • Async calls were captured by nothing, on both providers. The real call
    sites are AsyncCompletions.create and AsyncMessages.create; both
    integrations looked for an acreate method no shipped SDK exposes. No error,
    no span — async users simply got empty traces.
  • gpt-4o-mini was billed at gpt-4o rates. Pricing families are matched
    as substrings and gpt-4o is contained in gpt-4o-mini, so a first-match
    scan over-reported cost by 25–33x. Also fixes gpt-4-turbo and dated
    snapshots like claude-3-5-sonnet-20241022.
  • unpatch() never restored the original callables, so patch/unpatch cycles
    nested wrappers and duplicated every span and event.
  • An Anthropic message object that raised while serialising propagated out of
    the traced call — a tracer must never break the application it observes.

Why none of this was caught

Coverage was not the problem. The capture layer sat at 85–93%, and four tests
exercised the async path specifically. All four passed, because the fake SDK
they ran against was shaped around what the code calls rather than what the
vendors ship. A stub built to match the implementation will confirm any
implementation, including a broken one.

So 0.3.0 adds a test that asserts the opposite direction — that the attributes
we patch, and the callback hooks we override, exist on the real installed
SDKs — plus a CI job that installs openai, anthropic, langchain-core and
llama-index-core so that check actually runs instead of skipping.

Everything from the unreleased 0.2.0

0.2.0 was built but never published, so this release also carries the MCP
server, full-text search over runs, compare_runs, the LlamaIndex handler and
the Colab quickstart. Full detail in CHANGELOG.md.

Released through PyPI Trusted Publishing — no API token exists in this repo.