feat: add langgraph runtime - #5
Conversation
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
There was a problem hiding this comment.
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: langgraphin 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
There was a problem hiding this comment.
馃挕 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".
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Summary
runtime: langgraphregistration, routing, fixtures, catalog entry, and docs/v1/chat/completionsfacadelangchain-mcp-adapterssessions with declared-env-only subprocess envValidation
go test ./... -racepytest -qinruntimes/langgraph(28 passed)pytest -qinruntimes/pydantic-ai(13 passed)pytest -qinruntimes/microsoft-agent-framework(22 passed)docker buildx build . -f runtimes/langgraph/Dockerfile -t agentkit-serve-langgraph:test --loadmake build-agentkitmake build-test-agent RUNTIME=langgraph PLATFORM=linux/arm64/healthzand authenticated/v1/modelsfor the built LangGraph imageautoreviewfinal run: clean, no accepted/actionable findings