feat!: narrow AgentGraphRunner.run input from Any to str#177
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
Merged
jsonbailey
pushed a commit
that referenced
this pull request
May 14, 2026
🤖 I have created a release *beep* *boop* --- <details><summary>launchdarkly-server-sdk-ai: 0.20.0</summary> ## [0.20.0](launchdarkly-server-sdk-ai-0.19.0...launchdarkly-server-sdk-ai-0.20.0) (2026-05-13) ### ⚠ BREAKING CHANGES * Remove deprecated client method aliases and type aliases ([#179](#179)) * Narrow AgentGraphRunner.run input from Any to str ([#177](#177)) * Strip legacy judge messages on direct judge_config() path ([#174](#174)) * Rename LDAIMetrics.usage and AIGraphMetrics.usage to .tokens ([#175](#175)) * rename GraphMetrics/GraphMetricSummary to AIGraphMetrics/AIGraphMetricSummary ([#173](#173)) * Remove stale ManagedModel message management and AgentGraphResult type ([#170](#170)) ### Features * Narrow AgentGraphRunner.run input from Any to str ([#177](#177)) ([cc7a0fe](cc7a0fe)) * Remove deprecated client method aliases and type aliases ([#179](#179)) ([20df94b](20df94b)) * rename GraphMetrics/GraphMetricSummary to AIGraphMetrics/AIGraphMetricSummary ([#173](#173)) ([583939d](583939d)) * Rename LDAIMetrics.usage and AIGraphMetrics.usage to .tokens ([#175](#175)) ([d8c4a70](d8c4a70)) ### Bug Fixes * Remove stale ManagedModel message management and AgentGraphResult type ([#170](#170)) ([7d6ad23](7d6ad23)) * Strip legacy judge messages on direct judge_config() path ([#174](#174)) ([b7db754](b7db754)) </details> <details><summary>launchdarkly-server-sdk-ai-langchain: 0.7.0</summary> ## [0.7.0](launchdarkly-server-sdk-ai-langchain-0.6.0...launchdarkly-server-sdk-ai-langchain-0.7.0) (2026-05-13) ### ⚠ BREAKING CHANGES * Narrow AgentGraphRunner.run input from Any to str ([#177](#177)) * Rename LDAIMetrics.usage and AIGraphMetrics.usage to .tokens ([#175](#175)) * rename GraphMetrics/GraphMetricSummary to AIGraphMetrics/AIGraphMetricSummary ([#173](#173)) ### Features * Narrow AgentGraphRunner.run input from Any to str ([#177](#177)) ([cc7a0fe](cc7a0fe)) * rename GraphMetrics/GraphMetricSummary to AIGraphMetrics/AIGraphMetricSummary ([#173](#173)) ([583939d](583939d)) * Rename LDAIMetrics.usage and AIGraphMetrics.usage to .tokens ([#175](#175)) ([d8c4a70](d8c4a70)) </details> <details><summary>launchdarkly-server-sdk-ai-openai: 0.6.0</summary> ## [0.6.0](launchdarkly-server-sdk-ai-openai-0.5.0...launchdarkly-server-sdk-ai-openai-0.6.0) (2026-05-13) ### ⚠ BREAKING CHANGES * Narrow AgentGraphRunner.run input from Any to str ([#177](#177)) * Rename LDAIMetrics.usage and AIGraphMetrics.usage to .tokens ([#175](#175)) * rename GraphMetrics/GraphMetricSummary to AIGraphMetrics/AIGraphMetricSummary ([#173](#173)) ### Features * Narrow AgentGraphRunner.run input from Any to str ([#177](#177)) ([cc7a0fe](cc7a0fe)) * rename GraphMetrics/GraphMetricSummary to AIGraphMetrics/AIGraphMetricSummary ([#173](#173)) ([583939d](583939d)) * Rename LDAIMetrics.usage and AIGraphMetrics.usage to .tokens ([#175](#175)) ([d8c4a70](d8c4a70)) ### Bug Fixes * Always return ModelSettings from _build_model_settings ([#169](#169)) ([6d1ce4c](6d1ce4c)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: this PR only updates release metadata (versions/changelogs/provenance) with no functional code changes, though it publishes breaking-change API notes for consumers. > > **Overview** > **Release-only update** bumping package versions: `launchdarkly-server-sdk-ai` to `0.20.0`, LangChain provider to `0.7.0`, and OpenAI provider to `0.6.0`. > > Updates `.release-please-manifest.json`, `pyproject.toml` versions, SDK `__version__`, provenance docs, and adds new changelog entries documenting the breaking API renames/type tightenings included in these releases. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit a15b48e. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.