feat: Update OpenAI graph runner to return AgentGraphRunnerResult with GraphMetrics#155
Draft
jsonbailey wants to merge 1 commit intojb/aic-2174/graph-tracking-refactorfrom
Draft
Conversation
…h GraphMetrics Remove all direct LaunchDarkly tracker calls from OpenAIAgentGraphRunner. The runner now collects per-node metrics via _NodeMetricsAccumulator (a lightweight accumulator replacing the per-node LDAIConfigTracker) and returns AgentGraphRunnerResult with populated GraphMetrics (path, duration_ms, usage, node_metrics). Graph-level and per-node tracking events are emitted by ManagedAgentGraph._flush_graph_tracking() from the result. ManagedAgentGraph._flush_graph_tracking() is extended to also drive per-node tracking from result.metrics.node_metrics using the graph definition's node tracker factories. Integration tests in test_tracking_openai_agents.py are updated to run through the full ManagedAgentGraph pipeline (ManagedAgentGraph.run()) so tracking events are emitted by the managed layer as intended. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Draft
3 tasks
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
OpenAIAgentGraphRunner_NodeMetricsAccumulator— a lightweight per-node metrics collector replacingLDAIConfigTrackerinside the runnerAgentGraphRunnerResultwith populatedGraphMetrics(path,duration_ms,usage,node_metrics)ManagedAgentGraph._flush_graph_tracking()from the result metricsManagedAgentGraph._flush_graph_tracking()extended to drive per-node tracking fromresult.metrics.node_metricsusing graph node tracker factoriesManagedAgentGraph.run()pipeline (tracking events now come from the managed layer)track_handoff_success()calls removed (per spec:pathfield is sufficient; handoffs are not inGraphMetrics)Depends on
Test plan
uv run pytest packages/ai-providers/server-ai-openai/tests/)test_openai_agent_graph_runner.py: runner returns new shape, no tracker createdtest_tracking_openai_agents.py: graph-level and per-node events emitted through managed layer🤖 Generated with Claude Code