Skip to content

feat: add langgraph runtime - #5

Merged
sozercan merged 3 commits into
mainfrom
new-runtime
Jun 25, 2026
Merged

feat: add langgraph runtime#5
sozercan merged 3 commits into
mainfrom
new-runtime

Conversation

@sozercan

Copy link
Copy Markdown
Owner

Summary

  • add runtime: langgraph registration, routing, fixtures, catalog entry, and docs
  • add a LangChain/LangGraph adapter image that serves the existing AgentKit OpenAI /v1/chat/completions facade
  • support stdio MCP tools through persistent langchain-mcp-adapters sessions with declared-env-only subprocess env
  • add LangGraph conformance and guardrail tests, including MCP env isolation and token usage aggregation across tool-loop model calls

Validation

  • go test ./... -race
  • pytest -q in runtimes/langgraph (28 passed)
  • pytest -q in runtimes/pydantic-ai (13 passed)
  • pytest -q in runtimes/microsoft-agent-framework (22 passed)
  • docker buildx build . -f runtimes/langgraph/Dockerfile -t agentkit-serve-langgraph:test --load
  • make build-agentkit
  • make build-test-agent RUNTIME=langgraph PLATFORM=linux/arm64
  • smoke-tested /healthz and authenticated /v1/models for the built LangGraph image
  • autoreview final run: clean, no accepted/actionable findings

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Copilot AI review requested due to automatic review settings June 25, 2026 22:15
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.

This PR adds a new langgraph runtime adapter to AgentKit. It registers the runtime in the Go converter (const/spec/router), wires a LangChain/LangGraph Python adapter that serves the shared OpenAI /v1/chat/completions fa莽ade, supports stdio MCP tools via persistent langchain-mcp-adapters sessions with declared-env-only isolation, and adds fixtures, catalog entry, CI wiring, docs, and conformance/guardrail tests.

Changes:

  • Register runtime: langgraph in the Go runtime registry, router, validator, and constants (with tests).
  • Add the Python LangGraph adapter (agent_factory.py, __main__.py, Dockerfile, pyproject, tests) reusing the shared conformance suite and core fa莽ade.
  • Update docs, Makefile, CI, fixtures, and catalog to build/test the LangGraph adapter alongside pydantic-ai and MAF.
Show a summary per file
File Description
pkg/utils/const.go, runtime.go Add RuntimeLangGraph constant and registry entry
pkg/utils/runtime_test.go, pkg/build/router_test.go, pkg/agentkit/config/config_test.go Extend Go tests to cover the new runtime
runtimes/langgraph/agentkit_serve/agent_factory.py Core adapter: model build, MCP tool loading, message/usage mapping, run loop
runtimes/langgraph/agentkit_serve/init.py, main.py Package init and CLI binding
runtimes/langgraph/Dockerfile, pyproject.toml Adapter image and dependency declarations
runtimes/langgraph/tests/* Conformance re-export, conftest fixtures, guardrail tests
runtimes/common/agentkit_serve_common/conformance.py Add LangChain/LangGraph SDK roots to the import-boundary check
runtimes/catalog/langgraph.yaml Human-readable catalog entry
Makefile, .github/workflows/ci.yml Build/test/smoke targets for the LangGraph runtime
README.md, runtimes/langgraph/README.md, test/foundry-hosted-agent/README.md Documentation updates
test/agentkitfile-langgraph-hello.yaml, test/agentkitfile-langgraph-tools.yaml New build fixtures

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 22/22 changed files
  • Comments generated: 2
  • Review effort level: Medium

Comment thread runtimes/langgraph/Dockerfile Outdated
Comment thread runtimes/langgraph/pyproject.toml Outdated
Copilot AI review requested due to automatic review settings June 25, 2026 22:34

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

馃挕 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 52a34ff04f

鈩癸笍 About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 馃憤.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread runtimes/langgraph/agentkit_serve/agent_factory.py Outdated
Comment thread runtimes/langgraph/agentkit_serve/agent_factory.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review details

  • Files reviewed: 22/22 changed files
  • Comments generated: 0 new
  • Review effort level: Medium

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
@sozercan
sozercan merged commit 77676db into main Jun 25, 2026
14 checks passed
@sozercan
sozercan deleted the new-runtime branch June 25, 2026 23: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.

2 participants