refactor(harness)!: consolidate the Pydantic-AI harness + remove tracing handler#431
Merged
Merged
Conversation
3 tasks
4bb6bc7 to
86da19c
Compare
7007832 to
d7367a9
Compare
Contributor
Author
|
@greptile review |
1 similar comment
Contributor
Author
|
@greptile review |
d7367a9 to
97b0418
Compare
Contributor
Author
|
@greptile review |
58aaeb4 to
66cc86b
Compare
97b0418 to
c7b151c
Compare
66cc86b to
8dba84c
Compare
c7b151c to
176baf9
Compare
danielmillerp
approved these changes
Jun 23, 2026
8dba84c to
940e00d
Compare
176baf9 to
1b41f4d
Compare
940e00d to
c98b52e
Compare
1b41f4d to
7448a38
Compare
Base automatically changed from
declan-scale/harness-langgraph-consolidation
to
next
June 23, 2026 22:42
7448a38 to
4d6f4cf
Compare
d0b3075 to
7448a38
Compare
…ng handler Collapse _pydantic_ai_async / _pydantic_ai_tracing into _pydantic_ai_sync (convert helper) and _pydantic_ai_turn (stream_pydantic_ai_events). Span tracing is derived from the canonical stream by UnifiedEmitter, so create_pydantic_ai_tracing_handler is removed. BREAKING CHANGE: create_pydantic_ai_tracing_handler is removed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This PR removes create_pydantic_ai_tracing_handler from the public adk surface; document it here (the previous PR's entry was narrowed to the LangGraph handler it actually removed). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
7448a38 to
b30a90b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Fifth slice of #425. Mirrors the LangGraph consolidation (#430) for the Pydantic-AI harness.
Breaking
create_pydantic_ai_tracing_handler(and its handler class). Span tracing is derived from the canonical stream byUnifiedEmitter.Consolidation
_pydantic_ai_async.py+_pydantic_ai_tracing.pycollapsed into_pydantic_ai_sync.pyand_pydantic_ai_turn.py(stream_pydantic_ai_events).adk/__init__.pyre-wired (pydantic imports only).test_pydantic_ai_sync_unified.py.Test plan
pytestpydantic sync/async/turn + harness + conformance — 95 passedimport agentex.lib.adkclean; handler gone from__all__Notes
Stacked on #430. Retarget to
nextafter the chain merges.🤖 Generated with Claude Code
Greptile Summary
This PR completes the Pydantic-AI harness consolidation by removing the deprecated
create_pydantic_ai_tracing_handler/AgentexPydanticAITracingHandlerand collapsing the old_pydantic_ai_async.py+_pydantic_ai_tracing.pymodules into_pydantic_ai_turn.py. Span tracing is now derived automatically from the canonical event stream byUnifiedEmitter, matching the LangGraph consolidation in #430._pydantic_ai_async.py,_pydantic_ai_tracing.py, andtest_pydantic_ai_sync_unified.py— their functionality is absorbed into_pydantic_ai_turn.pyandtest_pydantic_ai_sync.py.tracing_handlerparameter removed fromPydanticAITurn.__init__,convert_pydantic_ai_to_agentex_events, andstream_pydantic_ai_events; all tracing is now opt-in viaUnifiedEmitter(trace_id=...)._FakeTracingclasses in the harness tests are replaced with a singleFakeTracingimported fromtests/lib/core/harness/_fakes.py.Confidence Score: 5/5
This refactor is safe to merge — it removes deprecated code paths in favor of the unified emitter, and all new and existing tests pass.
The consolidation is a pure refactor: functionality moves from old modules to new ones without introducing new behavior. The breaking change is clearly documented in CHANGELOG.md, test coverage is comprehensive (passthrough equivalence, span derivation, and both sync/async harness paths), and the deleted code has direct replacements.
No files require special attention
Important Files Changed
Sequence Diagram
%%{init: {'theme': 'neutral'}}%% sequenceDiagram participant Caller participant stream_pydantic_ai_events participant PydanticAITurn participant convert_pydantic_ai_to_agentex_events participant UnifiedEmitter note over Caller,UnifiedEmitter: New consolidated path (this PR) Caller->>stream_pydantic_ai_events: stream, task_id stream_pydantic_ai_events->>PydanticAITurn: "PydanticAITurn(stream, model=None)" stream_pydantic_ai_events->>UnifiedEmitter: "UnifiedEmitter(task_id, trace_id=None, parent_span_id=None)" stream_pydantic_ai_events->>UnifiedEmitter: auto_send_turn(turn) UnifiedEmitter->>PydanticAITurn: turn.events PydanticAITurn->>convert_pydantic_ai_to_agentex_events: stream (no tracing_handler) convert_pydantic_ai_to_agentex_events-->>PydanticAITurn: "StreamTaskMessage* events" PydanticAITurn-->>UnifiedEmitter: "StreamTaskMessage* events" UnifiedEmitter-->>UnifiedEmitter: derive spans (if trace_id provided) UnifiedEmitter-->>stream_pydantic_ai_events: TurnResult stream_pydantic_ai_events-->>Caller: result.final_text%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% sequenceDiagram participant Caller participant stream_pydantic_ai_events participant PydanticAITurn participant convert_pydantic_ai_to_agentex_events participant UnifiedEmitter note over Caller,UnifiedEmitter: New consolidated path (this PR) Caller->>stream_pydantic_ai_events: stream, task_id stream_pydantic_ai_events->>PydanticAITurn: "PydanticAITurn(stream, model=None)" stream_pydantic_ai_events->>UnifiedEmitter: "UnifiedEmitter(task_id, trace_id=None, parent_span_id=None)" stream_pydantic_ai_events->>UnifiedEmitter: auto_send_turn(turn) UnifiedEmitter->>PydanticAITurn: turn.events PydanticAITurn->>convert_pydantic_ai_to_agentex_events: stream (no tracing_handler) convert_pydantic_ai_to_agentex_events-->>PydanticAITurn: "StreamTaskMessage* events" PydanticAITurn-->>UnifiedEmitter: "StreamTaskMessage* events" UnifiedEmitter-->>UnifiedEmitter: derive spans (if trace_id provided) UnifiedEmitter-->>stream_pydantic_ai_events: TurnResult stream_pydantic_ai_events-->>Caller: result.final_textReviews (10): Last reviewed commit: "docs(changelog): record Pydantic-AI trac..." | Re-trigger Greptile