feat!: narrow AgentGraphRunner.run input from Any to str#177
Merged
jsonbailey merged 1 commit intomainfrom May 7, 2026
Merged
Conversation
Aligns with Runner.run (already narrowed in #165) and with the JS AgentGraphRunner interface, which already takes string. The spec is being updated in parallel (sdk-specs#164). BREAKING CHANGE: AgentGraphRunner.run(input: Any) is now AgentGraphRunner.run(input: str). Callers must pass a str. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
f02f6f1 to
d669bbe
Compare
keelerm84
approved these changes
May 7, 2026
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
Narrows the
AgentGraphRunner.runinput type fromAnytostracross the protocol (server-ai) and both concrete implementations (server-ai-openai,server-ai-langchain). Also narrowsManagedAgentGraph.run(which forwards directly to the runner) for type-consistency.Brings
AgentGraphRunner.runin line withRunner.run(narrowed in #165) and matches the JSAgentGraphRunnerinterface infeat/next-ai-release, which already acceptsstring. The spec is updated in parallel in sdk-specs#164.Changes
packages/sdk/server-ai/src/ldai/providers/agent_graph_runner.py— protocol declaresrun(input: str); dropped unusedAnyimport.packages/sdk/server-ai/src/ldai/managed_agent_graph.py—ManagedAgentGraph.run(input: str)to match the underlying runner; dropped unusedAnyimport.packages/ai-providers/server-ai-openai/src/ldai_openai/openai_agent_graph_runner.py— narrowedrunsignature; removed redundantstr(input)coercion.packages/ai-providers/server-ai-langchain/src/ldai_langchain/langgraph_agent_graph_runner.py— narrowedrunsignature; removed redundantstr(input)coercion inHumanMessageconstruction.BREAKING CHANGE
AgentGraphRunner.run(input: Any)is nowAgentGraphRunner.run(input: str).ManagedAgentGraph.run(input: Any)is nowManagedAgentGraph.run(input: str). Callers passing non-string inputs must coerce tostrat the call site.Test plan
make test— 329 tests pass across server-ai, server-ai-langchain, server-ai-openaimake lint— mypy, isort, pycodestyle clean across all three packagesNote
Medium Risk
This is a breaking API change that will require downstream callers passing non-string inputs to update, but runtime behavior changes are minimal (removal of implicit
str()coercion).Overview
Narrows the agent-graph execution API to accept only string prompts by changing
AgentGraphRunner.runandManagedAgentGraph.runfrominput: Anytoinput: str.Updates the OpenAI and LangGraph runner implementations to match the new signature and removes redundant
str(input)coercions when constructing messages / invokingRunner.run.Reviewed by Cursor Bugbot for commit d669bbe. Bugbot is set up for automated code reviews on this repo. Configure here.