Skip to content

feat: Update OpenAI graph runner to return AgentGraphRunnerResult with GraphMetrics#155

Draft
jsonbailey wants to merge 1 commit intojb/aic-2174/graph-tracking-refactorfrom
jb/aic-2174/openai-graph-runner
Draft

feat: Update OpenAI graph runner to return AgentGraphRunnerResult with GraphMetrics#155
jsonbailey wants to merge 1 commit intojb/aic-2174/graph-tracking-refactorfrom
jb/aic-2174/openai-graph-runner

Conversation

@jsonbailey
Copy link
Copy Markdown
Contributor

Summary

  • Removes all direct LaunchDarkly tracker calls from OpenAIAgentGraphRunner
  • Introduces _NodeMetricsAccumulator — a lightweight per-node metrics collector replacing LDAIConfigTracker inside the runner
  • Runner now 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 metrics
  • ManagedAgentGraph._flush_graph_tracking() extended to drive per-node tracking from result.metrics.node_metrics using graph node tracker factories
  • Integration tests updated to exercise the full ManagedAgentGraph.run() pipeline (tracking events now come from the managed layer)
  • Handoff-level track_handoff_success() calls removed (per spec: path field is sufficient; handoffs are not in GraphMetrics)

Depends on

Test plan

  • All existing tests pass (uv run pytest packages/ai-providers/server-ai-openai/tests/)
  • test_openai_agent_graph_runner.py: runner returns new shape, no tracker created
  • test_tracking_openai_agents.py: graph-level and per-node events emitted through managed layer

🤖 Generated with Claude Code

@jsonbailey jsonbailey force-pushed the jb/aic-2174/graph-tracking-refactor branch from fcbcb18 to 9286d53 Compare April 29, 2026 13:15
@jsonbailey jsonbailey force-pushed the jb/aic-2174/openai-graph-runner branch from 9733a28 to 44501e3 Compare April 29, 2026 13:15
@jsonbailey jsonbailey force-pushed the jb/aic-2174/graph-tracking-refactor branch from 9286d53 to 72fc13e Compare April 29, 2026 13:19
@jsonbailey jsonbailey force-pushed the jb/aic-2174/openai-graph-runner branch from 44501e3 to 142e041 Compare April 29, 2026 13:19
@jsonbailey jsonbailey force-pushed the jb/aic-2174/graph-tracking-refactor branch from 72fc13e to bde4f09 Compare April 29, 2026 13:22
@jsonbailey jsonbailey force-pushed the jb/aic-2174/openai-graph-runner branch from 142e041 to fb3c0f6 Compare April 29, 2026 13:22
@jsonbailey jsonbailey force-pushed the jb/aic-2174/graph-tracking-refactor branch from bde4f09 to c376011 Compare April 29, 2026 13:52
@jsonbailey jsonbailey force-pushed the jb/aic-2174/openai-graph-runner branch from fb3c0f6 to b3547b0 Compare April 29, 2026 13:52
@jsonbailey jsonbailey force-pushed the jb/aic-2174/graph-tracking-refactor branch from c376011 to 7f67e4f Compare April 29, 2026 13:57
@jsonbailey jsonbailey force-pushed the jb/aic-2174/openai-graph-runner branch from b3547b0 to 1d4ddb2 Compare April 29, 2026 13:57
@jsonbailey jsonbailey force-pushed the jb/aic-2174/graph-tracking-refactor branch from 7f67e4f to a89c6a2 Compare April 29, 2026 14:38
@jsonbailey jsonbailey force-pushed the jb/aic-2174/openai-graph-runner branch from 1d4ddb2 to 6201d09 Compare April 29, 2026 14:38
@jsonbailey jsonbailey force-pushed the jb/aic-2174/graph-tracking-refactor branch from a89c6a2 to c69a9ff Compare April 29, 2026 16:33
@jsonbailey jsonbailey force-pushed the jb/aic-2174/openai-graph-runner branch from 6201d09 to ef4216c Compare April 29, 2026 16:34
@jsonbailey jsonbailey force-pushed the jb/aic-2174/graph-tracking-refactor branch from c69a9ff to 14cfa92 Compare April 30, 2026 14:03
@jsonbailey jsonbailey force-pushed the jb/aic-2174/openai-graph-runner branch from ef4216c to 8ecce16 Compare April 30, 2026 14:05
@jsonbailey jsonbailey force-pushed the jb/aic-2174/graph-tracking-refactor branch from 14cfa92 to 1ed1a44 Compare April 30, 2026 14:23
@jsonbailey jsonbailey force-pushed the jb/aic-2174/openai-graph-runner branch 2 times, most recently from 8ecce16 to 09af502 Compare April 30, 2026 14:23
@jsonbailey jsonbailey force-pushed the jb/aic-2174/graph-tracking-refactor branch from 1ed1a44 to f016b0d Compare April 30, 2026 14:46
…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>
@jsonbailey jsonbailey force-pushed the jb/aic-2174/openai-graph-runner branch from 09af502 to 43bc879 Compare April 30, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant