Conversation
…raphResponse Co-Authored-By: Paul Loeb <ploeb@launchdarkly.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
|
@cursor review |
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
graph().invoke()already accumulates the traversal path and each node's response internally (it sends the path as$ld:ai:graph:path), butProviderGraphResponsedropped both — so an app cannot tell which branch the router picked. This returns them.Closes AIC-3211.
export type ProviderGraphResponse = { response: string; usage: TokenUsage; judgeResults?: ProviderResponse['judgeResults']; + path: string[]; + nodes?: Record<string, ProviderResponse>; };pathis required: every graph execution path is knowable, including the native runners (toClaudeAgents(),toOpenAIAgents(),toLangGraph()), which already track it.nodesis optional: native runners delegate traversal to the framework and do not produce aProviderResponseper node.Implementation details
Reported by Ben in #proj-turnkey-ai-sdk: he had a route badge showing which node the router picked, and had to scrap it when switching to
graph().invoke().graph().invoke()'saccumulate()already pushesnode.keyintopathand storesnodes[node.key] = res; the return statement just omitted them. The threenative-graph.tsrunners already build apatharray for their own telemetry and now return it.The fine-grained alternative that exists today —
resolveGraph()+def.route(), which returns{...response, next}— is documented alongside the new fields.Verified with
make code-check,make build,make typecheck, andmake test(all packages pass). A new test asserts path order and per-node responses on a two-node graph.Graph-level streaming (AIC-3210) is the other half of Ben's report and follows in a separate PR.
Link to Devin session: https://app.devin.ai/sessions/978ca9b3c9634c60abb7385a945d17bc
Requested by: @ld-paul