v0.3.0 — install() actually works
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 areAsyncCompletions.createandAsyncMessages.create; both
integrations looked for anacreatemethod no shipped SDK exposes. No error,
no span — async users simply got empty traces. gpt-4o-miniwas billed atgpt-4orates. Pricing families are matched
as substrings andgpt-4ois contained ingpt-4o-mini, so a first-match
scan over-reported cost by 25–33x. Also fixesgpt-4-turboand dated
snapshots likeclaude-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.