refactor(harness)!: consolidate the LangGraph harness + remove tracing handler#430
Merged
Merged
Conversation
2 tasks
a6a4a30 to
fb4111f
Compare
4bb6bc7 to
86da19c
Compare
Contributor
Author
|
@greptile review |
2 similar comments
Contributor
Author
|
@greptile review |
Contributor
Author
|
@greptile review |
fb4111f to
c9f7ab7
Compare
58aaeb4 to
66cc86b
Compare
c9f7ab7 to
8debccd
Compare
66cc86b to
8dba84c
Compare
8debccd to
758d5f8
Compare
c5c0a3a to
37c7d9d
Compare
danielmillerp
approved these changes
Jun 23, 2026
8dba84c to
940e00d
Compare
… handler Collapse _langgraph_async / _langgraph_messages / _langgraph_tracing into _langgraph_sync (emit_langgraph_messages, convert helpers) and _langgraph_turn (stream_langgraph_events). Span tracing is now derived from the canonical stream by UnifiedEmitter, so create_langgraph_tracing_handler is removed. Public facade names are unchanged except the removed handler. All in-repo consumers were migrated to the unified surface in the preceding PRs. BREAKING CHANGE: create_langgraph_tracing_handler is removed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Address Greptile review: the breaking-change entry listed create_pydantic_ai_tracing_handler as removed, but that handler is still exported here and is only removed in the following PR. Narrow this entry to the LangGraph handler actually removed in this change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
940e00d to
c98b52e
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
Fourth slice of #425. Consolidates the LangGraph harness filesystem and removes the deprecated tracing handler.
Breaking
create_langgraph_tracing_handler(and its handler class). Span tracing is now derived from the canonical stream byUnifiedEmitter.Consolidation
_langgraph_async.py+_langgraph_messages.py+_langgraph_tracing.pycollapsed into_langgraph_sync.py(emit_langgraph_messages,convert_langgraph_to_agentex_events) and_langgraph_turn.py(stream_langgraph_events).adk/__init__.pyre-wired (langgraph imports only; pydantic untouched here).core/harness/auto_send.py/tracer.py;harness.md+ CHANGELOG.Public facade names are unchanged apart from the removed handler. All in-repo consumers (tutorials, templates) were migrated in #428/#429.
Test plan
pytestlanggraph sync/async/temporal + conformance — 45 passedimport agentex.lib.adkclean; handler gone from__all__Notes
Stacked on #429. Retarget to
nextafter the chain merges.🤖 Generated with Claude Code
Greptile Summary
Collapses five LangGraph harness files (
_langgraph_async.py,_langgraph_messages.py,_langgraph_tracing.py, plus the pre-existing_langgraph_sync.pyand_langgraph_turn.py) into two canonical modules, and removes the deprecatedcreate_langgraph_tracing_handleras a hard breaking change. All public facade names (stream_langgraph_events,emit_langgraph_messages,convert_langgraph_to_agentex_events,LangGraphTurn) are preserved.stream_langgraph_eventsmoves from_langgraph_async.py→_langgraph_turn.py;emit_langgraph_messagesmoves from_langgraph_messages.py→_langgraph_sync.py; both implementations are byte-for-byte identical to the deleted originals.AgentexLangGraphTracingHandler/create_langgraph_tracing_handlerare deleted entirely; span tracing is now derived from the canonical stream byUnifiedEmitter._FakeTracingtest double are consolidated into a newtests/lib/core/harness/_fakes.py;test_langgraph_sync_unified.pyis absorbed intotest_langgraph_sync.py.Confidence Score: 5/5
Safe to merge — all moved functions are byte-for-byte identical to their deleted originals, the public facade is unchanged, and the full test suite (45 tests) passes.
This is a pure filesystem consolidation: no logic was altered, only file locations changed. Each moved symbol (
stream_langgraph_events,emit_langgraph_messages) is identical to what it replaces. The only net-new code is the_fakes.pytest helper consolidation and the addition ofstream_langgraph_eventsto_langgraph_turn.py. The single comment to fix is a misleading docstring in a test file.No files require special attention.
Important Files Changed
stream_langgraph_eventsnow sourced from_langgraph_turn,emit_langgraph_messagesfrom_langgraph_sync;create_langgraph_tracing_handlerremoved from public surface and__all__.stream_langgraph_eventsfrom the deleted_langgraph_async.py; implementation is identical —LangGraphTurn+UnifiedEmitter.auto_send_turnwithworkflow_now_if_in_workflow(). Module-level doc comment cleaned up (ticket refs removed).emit_langgraph_messagesverbatim from the deleted_langgraph_messages.py; logic is unchanged. Module now owns both the streaming converter and the non-streaming message emitter.stream_langgraph_eventsmoved to_langgraph_turn.py.emit_langgraph_messagesmoved to_langgraph_sync.py.AgentexLangGraphTracingHandlerandcreate_langgraph_tracing_handlerremoved as a documented breaking change; no replacement needed sinceUnifiedEmitterderives spans from the canonical stream.test_langgraph_sync_unified.py(passthrough + span derivation tests) into this file; replaces the deletedTestLangGraphTracingHandlerBackwardCompat. Module-levelautouse=True_real_langchain_corefixture correctly covers the new test classes.test_langgraph_sync.py.FakeTracing/FakeSpanfrom three duplicated test-local implementations; exposes convenience propertiesstarted_names,started_pairs,ended_outputsto keep shape-2/shape-3 assertions clean._FakeTracing/_FakeSpan; importsFakeTracingfrom_fakes. Doc updated to reflect that Full tool events now produce spans (previously asserted they didn't)._FakeTracingdedup as the async harness test; logic unchanged.stream_langgraph_eventsupdated to its new home in_langgraph_turn; one docstring phrase about "Redis-streaming code" is misleading but harmless.stream_langgraph_eventsnow from_langgraph_turninstead of the deleted_langgraph_async.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD subgraph before["Before (5 files)"] A1[_langgraph_async.py\nstream_langgraph_events] A2[_langgraph_messages.py\nemit_langgraph_messages] A3[_langgraph_tracing.py\ncreate_langgraph_tracing_handler\nAgentexLangGraphTracingHandler] A4[_langgraph_sync.py\nconvert_langgraph_to_agentex_events] A5[_langgraph_turn.py\nLangGraphTurn] end subgraph after["After (2 files)"] B1[_langgraph_turn.py\nLangGraphTurn\nstream_langgraph_events] B2[_langgraph_sync.py\nconvert_langgraph_to_agentex_events\nemit_langgraph_messages] B3[REMOVED\ncreate_langgraph_tracing_handler] end A1 -->|moved to| B1 A5 -->|stays in| B1 A2 -->|moved to| B2 A4 -->|stays in| B2 A3 -->|deleted| B3 B1 & B2 --> C[adk/__init__.py\npublic surface unchanged]%%{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"}}}%% flowchart TD subgraph before["Before (5 files)"] A1[_langgraph_async.py\nstream_langgraph_events] A2[_langgraph_messages.py\nemit_langgraph_messages] A3[_langgraph_tracing.py\ncreate_langgraph_tracing_handler\nAgentexLangGraphTracingHandler] A4[_langgraph_sync.py\nconvert_langgraph_to_agentex_events] A5[_langgraph_turn.py\nLangGraphTurn] end subgraph after["After (2 files)"] B1[_langgraph_turn.py\nLangGraphTurn\nstream_langgraph_events] B2[_langgraph_sync.py\nconvert_langgraph_to_agentex_events\nemit_langgraph_messages] B3[REMOVED\ncreate_langgraph_tracing_handler] end A1 -->|moved to| B1 A5 -->|stays in| B1 A2 -->|moved to| B2 A4 -->|stays in| B2 A3 -->|deleted| B3 B1 & B2 --> C[adk/__init__.py\npublic surface unchanged]Reviews (9): Last reviewed commit: "docs(changelog): scope breaking-change t..." | Re-trigger Greptile