docs(skills): fix broken refs in adk-workflow skill#6044
Conversation
Five doc bugs in the adk-workflow skill produce import errors, attribute errors, or misleading guidance against the published google-adk wheel and v2 source. Each verified empirically against google-adk==2.2.0 and the v2 dev branch: - advanced-patterns.md: remove hard-coded file:///Users/deanchen/... link to dynamic-nodes.md; use a relative path. - testing.md: rewrite examples to use the public InMemoryRunner from google.adk.runners instead of `tests.unittests.workflow.testing_utils` (which raises ModuleNotFoundError under pip install). Replace MockModel with a FakeLlm(BaseLlm) pattern. Three rewritten snippets executed end-to-end against google-adk==2.2.0 and pass. - llm-agent-nodes.md: correct the claim that LlmAgentWrapper outputs types.Content. process_llm_agent_output (in _llm_agent_wrapper.py) sets event.output = text (a str) when output_schema is unset, and the validated model_dump dict when set. Drop the workaround section and update the summary table. - parallel-and-fanout.md, import-paths.md: stop importing the non-existent `ParallelWorker` from the private `_parallel_worker` module (only `_ParallelWorker` exists and the path is private). Rewrite samples to use the documented `parallel_worker=True` flag. - state-and-events.md, advanced-patterns.md: drop `triggered_by`, `in_nodes`, `execution_id`, `retry_count`, and `get_next_child_execution_id` from the Context property/method tables and code samples — none of them exist on Context in v2. Rename `retry_count` → `attempt_count` (the live name).
|
CI failures here are pre-existing on Same failure is reproducible on the most recent unrelated v2 PR (#5938), which never touched any Python code. This PR only modifies markdown files under |
process_llm_agent_output writes event.output internally, but the framework clears it before the event surfaces to user code in runner.run_async(...). The validated value still flows forward to the next node's node_input and to session.state[output_key] — the user- facing surface that matters. Spell out the caveat and direct readers to alternative assertion targets so tests do not false-fail when checking event.output on an LLM agent's own event.
|
Added one follow-up commit ( While doing a fuller verification pass of the skill, I traced |
Summary
Fixes 5 documentation bugs in the
adk-workflowskill onv2. Each is empirically verified againstgoogle-adk==2.2.0andv2source. Full verification transcript inline below.Fixes in this PR
advanced-patterns.md— Remove the hard-coded local-filesystem URLfile:///Users/deanchen/Desktop/...left in a doc link; replace with the relative pathdynamic-nodes.md.testing.md— All examples imported fromtests.unittests.*, which is not in the publishedgoogle-adkwheel. Rewrite to use the publicfrom google.adk.runners import InMemoryRunnerplus a small inlinerun()helper. Three rewritten snippets (basic workflow, state, parallel worker) were executed end-to-end againstgoogle-adk==2.2.0and pass. TheMockModelsection is replaced with aFakeLlm(BaseLlm)pattern that uses only public symbols.llm-agent-nodes.md— The doc claims "LlmAgentWrapper outputstypes.Content, NOTstr." The source (_llm_agent_wrapper.process_llm_agent_output) setsevent.output = text(astr) whenoutput_schemais unset, and the validated dict when set. Rewrite the section, the table, and drop the "useAnyand extract text" workaround that depended on the wrong claim.parallel-and-fanout.md+import-paths.md— Dropfrom google.adk.workflow._parallel_worker import ParallelWorker. The class doesn't exist under that name; only the private_ParallelWorkerdoes. The same files already document the public API (parallel_worker=Trueflag on@nodeorLlmAgent) — rewrite samples to use it consistently.state-and-events.md(+ one cross-reference inadvanced-patterns.md) — Droptriggered_by,in_nodes,execution_id,retry_countfrom theContextproperty tables and code samples. None of them exist onContextin v2 source (verified bygrepinsrc/google/adk/agents/context.py). Renameretry_count→attempt_count(the live name). Also dropget_next_child_execution_idfrom the methods table for the same reason.Scope
All five fixes target the same file tree (
.agents/skills/adk-workflow/references/) with the same concern: "skill docs reference symbols/imports/paths that don't exist." Per CONTRIBUTING.md "small, focused PRs", they're bundled because each is a surgical edit and they share verification setup. Happy to split if reviewers prefer.Testing plan
Doc-only changes. No source code or behavior modified.
Pip-install reproduction of every bug claimed in a clean venv with
google-adk==2.2.0. See "Verification details" below for the verbatimImportError,hasattr == False, and source quotes that prove each claim.Rewritten
testing.mdsnippets executed end-to-end againstgoogle-adk==2.2.0:test_simple_workflow— PASSEDtest_state_management— PASSEDtest_parallel_worker— PASSEDPre-commit hooks ran clean on the changed files.
mdformatis excluded for.agents/by the repo's.pre-commit-config.yaml, and the other hooks (isort,pyink,addlicense) target Python/shell files only.Notes for reviewers
2.2.0+v2HEAD as of the date of this PR.testing.mdrewrite is the largest delta (~500 lines), but almost every line either drops atests.unittests.*import or replaces atesting_utils.Xcall with public-API equivalents.{name}__{index}) was dropped from this PR after confirming it had already been fixed on v2 to use{name}@{run_id}withrun_idstarting at"1".Verification details
Setup:
Bug 1 — Hard-coded
file:///URLA developer's local filesystem path leaked into the published skill.
Bug 2 —
tests.unittests...imports unreachable frompip installThe
tests/directory ships only in the source repo, not in the installedgoogle-adkwheel. Any user copying these snippets getsModuleNotFoundError. The PR rewrites samples to use the publicfrom google.adk.runners import InMemoryRunnerand demonstrates a publicly-importable mock pattern (subclassBaseLlm).The three rewritten snippets (basic, state, parallel) were run end-to-end against
google-adk==2.2.0and all three passed.Bug 3 —
LlmAgentWrapperoutput type doc is wrongThe skill claims: "LlmAgentWrapper outputs
types.Content, NOTstr."The source in both
2.2.0andv2says otherwise. Fromsrc/google/adk/workflow/_llm_agent_wrapper.py:When
output_schemais unset,event.outputis the concatenated string of the model's text parts. Whenoutput_schema=MyModelis set, it's the validatedmodel_dump()dict. The PR rewrites the section, table, and the "useAnyand extract text" workaround that depended on the wrong claim.Bug 4 —
_parallel_worker.ParallelWorkeris not importableThe class doesn't exist under that name — only the underscore-prefixed
_ParallelWorkerdoes, and that path is private:The recommended public API is the
parallel_worker=Trueflag — already documented as preferred in the same files. Verified end-to-end:PR drops the private import from
parallel-and-fanout.mdand theimport-paths.mdtable, and rewrites samples to use the flag.Bug 5 — Removed
Contextproperties documented as liveThe same is true on
v2source —grepfor those names insrc/google/adk/agents/context.pyreturns nothing, whileattempt_counthas 4 hits.Code samples using
ctx.retry_count/ctx.triggered_byraiseAttributeError. PR removes the four absent properties from the docs and renamesretry_count→attempt_counteverywhere it's mentioned.get_next_child_execution_idis also gone fromContexton v2; the PR removes it from the methods table for the same reason.