Repository navigation
fix(cli): read Workflow.graph when drawing the dev UI graph - #7529
Open
khairulislam wants to merge 6 commits into
Open
khairulislam wants to merge 6 commits into
khairulislam wants to merge 6 commits into
Conversation
build_graph() read agent._graph, but Workflow stores its compiled graph in the
public `graph` field. Any Workflow root agent therefore raised
AttributeError: 'Workflow' object has no attribute '_graph', so
/dev/apps/{app}/graph returned a 500 and the dev UI could not draw the graph.
Fixes google#7528
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
khairulislam
force-pushed
the
fix/agent-graph-workflow-private-graph
branch
from
October 14, 2026 15:25
67332fd to
b94952b
Compare
Author
|
Test output from |
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.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
Problem:
build_graph()readsagent._graphforWorkflowagents, butWorkflowonly has the public fieldgraph. AnyWorkflowroot agent makesGET /dev/apps/{app_name}/graphreturn 500, so the dev UI cannot draw the workflow:Running the workflow is not affected. Present in v2.11.0, v2.12.0 and
main.Solution:
Use
agent.graph(3 occurrences). No other change.Testing Plan
Unit Tests:
Added
test_build_graph_workflow_draws_nodes_and_edges_from_its_graphtotests/unittests/cli/test_agent_graph.py: aWorkflowwith an agent, function nodes, a retry back-edge and aDEFAULT_ROUTEedge. It fails onmainwith theAttributeErrorabove and passes with this change.Manual End-to-End (E2E) Tests:
adk webwith aWorkflowroot agent (plan -> review -> write -> review, each review looping back on aretryroute):GET /dev/apps/<app>/graphreturns 500 onmain. With this change it returns 200 and the DOT source includes the nodes and the retry back-edges (review_outline -> BlogPlanner,review_post -> BlogWriter).Checklist