fix(trace): restore Phoenix collector compatibility - #339
fix(trace): restore Phoenix collector compatibility#339Jake Present (jakepresent) wants to merge 3 commits into
Conversation
Chang Liu (changliu2)
left a comment
There was a problem hiding this comment.
I found four issues tightly coupled to restoring the previously unreachable Phoenix adapter:
assert_ai/core/collector.py:273-288still discards Phoenix span events. A minimal event-onlygen_ai.choicespan produces no ASSERTtrace_events; preserving the event produces the expected assistant message. This breaks GenAI output and tool evidence after the adapter becomes operational.assert_ai/core/collector.py:250-288preserves Phoenix's default newest-first DataFrame ordering. ASSERT consumes spans sequentially, so a minimal two-span trace is emitted asfinal answerfollowed byinitial answer. Sort converted spans chronologically.assert_ai/core/collector.py:162-185appliestrace_idsonly after retrieving Phoenix's capped unfiltered DataFrame. Existing traces outside that page silently disappear. Phoenix 15.0 and 19.17 both provide server-sidetrace_idsfiltering with cursor pagination throughclient.spans.get_spans(...)..github/workflows/build.yml:103-160runs the installed-wheel compatibility tests only against the resolver-selected Phoenix 19.17.0. There is no required job pinning the supported 15.0.0 lower bound.
I am not retaining the concurrent-session finding: that behavior is broader pre-existing design, and this PR improves rather than worsens cross-run isolation by restoring effective time bounds.
|
Addressed all four findings on exact head |
Summary
PhoenixCollectoragainst the supported Phoenix 15.0–19.17 client API.span_kind, timezone-aware timestamps, and missing Pandas values.phoenixextra.Problem
PhoenixCollectorcould not be constructed with any supported Phoenix release because it called the removedphoenix.Client(endpoint=...)surface. After correcting construction, retrieval still used the removed top-levelget_spans_dataframemethod. The supported API isphoenix.client.Client(base_url=...)followed byclient.spans.get_spans_dataframe(...).The collector protocol supplies ISO timestamp strings, while Phoenix expects
datetimeobjects and silently normalizes strings toNone. That dropped the intended turn bounds. The old DataFrame conversion also calledint()on PhoenixTimestampvalues and missed span IDs stored in the DataFrame index.Verification
19 passed.1492 passed, 21 skipped, 840 subtests passed.assert-ai[phoenix]environment: all 5 compatibility tests passed against Phoenix 19.17.0, importing ASSERT from site-packages rather than the checkout.uv lock --check, diff hygiene, focused Ruff, Python compilation, wheel/sdist build, andtwine checkpassed.Scope
This is the focused follow-up identified while reviewing #336. It does not wire
PhoenixCollectorinto the CLI/config path or change theSpanCollectorprotocol; it repairs the existing public programmatic adapter and locks its real dependency contract in required CI.