Skip to content

feat: Add ManagedAgentGraph support#111

Open
jsonbailey wants to merge 11 commits intomainfrom
jb/aic-1664/managed-agent-graph
Open

feat: Add ManagedAgentGraph support#111
jsonbailey wants to merge 11 commits intomainfrom
jb/aic-1664/managed-agent-graph

Conversation

@jsonbailey
Copy link
Copy Markdown
Contributor

@jsonbailey jsonbailey commented Mar 25, 2026

feat: Add OpenAIAgentGraphRunner support
feat: Add LangGraphAgentGraphRunner support


Note

Medium Risk
Adds new agent-graph execution paths for both OpenAI Agents and LangGraph, including tool invocation and metric tracking, which could affect runtime behavior and observability. Risk is mitigated by being additive and guarded by optional dependencies (openai-agents/langgraph) with explicit failure handling.

Overview
Adds first-class managed agent graph execution via new ManagedAgentGraph and LDAIClient.create_agent_graph(), returning a runnable wrapper around a provider-specific AgentGraphRunner and tracking a new $ld:ai:usage:create-agent-graph event.

Introduces two new provider implementations: OpenAIAgentGraphRunner (OpenAI Agents SDK) and LangGraphAgentGraphRunner (LangGraph), plus create_agent_graph() wiring in OpenAIRunnerFactory and LangChainRunnerFactory and exports in each provider package. Both runners execute an AgentGraphDefinition, integrate tool registries, and record graph/node metrics (path, latency, success/failure, token usage; plus handoff/tool-call tracking for OpenAI).

Written by Cursor Bugbot for commit f1836a4. This will update automatically on new commits. Configure here.

@jsonbailey jsonbailey changed the title feat: Add ManagedAgentGraph support feat: Add ManagedAgentGraph support (PR-6) Mar 25, 2026
@jsonbailey jsonbailey marked this pull request as ready for review March 25, 2026 22:05
@jsonbailey jsonbailey requested a review from a team as a code owner March 25, 2026 22:05
@jsonbailey jsonbailey force-pushed the jb/aic-1664/managed-agent-graph branch from 226dfdf to e57a147 Compare March 25, 2026 22:22
@jsonbailey jsonbailey changed the base branch from jb/aic-1664/runner-abcs to jb/aic-1664/graph-tracking-improvements March 25, 2026 22:23
@jsonbailey jsonbailey force-pushed the jb/aic-1664/graph-tracking-improvements branch from 886e3b7 to a183f12 Compare March 26, 2026 17:49
Base automatically changed from jb/aic-1664/graph-tracking-improvements to main March 26, 2026 18:51
@jsonbailey jsonbailey changed the title feat: Add ManagedAgentGraph support (PR-6) feat: Add ManagedAgentGraph support Mar 26, 2026
jsonbailey and others added 2 commits March 26, 2026 14:26
…aphRunner

Implements PR 5 — ManagedAgentGraph + create_agent_graph():

ldai:
- managed_agent_graph.py: ManagedAgentGraph wrapper holding AgentGraphRunner
  + AIGraphTracker; exposes run(), get_agent_graph_runner(), get_tracker()
- LDAIClient.create_agent_graph(key, context, tools): resolves graph via
  agent_graph(), delegates to RunnerFactory, returns ManagedAgentGraph
- Exports ManagedAgentGraph from top-level ldai package

ldai_openai:
- OpenAIAgentGraphRunner(AgentGraphRunner): builds agents via reverse_traverse
  using the openai-agents SDK; auto-tracks path, tool calls, handoffs,
  latency, invocation success/failure
- OpenAIRunnerFactory.create_agent_graph(graph_def, tools) -> OpenAIAgentGraphRunner

ldai_langchain:
- LangGraphAgentGraphRunner(AgentGraphRunner): builds a LangGraph StateGraph
  via traverse(); auto-tracks latency and invocation success/failure
- LangChainRunnerFactory.create_agent_graph(graph_def, tools) -> LangGraphAgentGraphRunner

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…n rollup

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jsonbailey jsonbailey force-pushed the jb/aic-1664/managed-agent-graph branch from e57a147 to be26d6d Compare March 26, 2026 19:39
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

)


class LangGraphAgentGraphRunner(AgentGraphRunner):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This name is a little ridiuclous.

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.

2 participants