Skip to content

docs: rename the duplicate snippet region in the multi-agent example - #2488

Open
AAliKKhan wants to merge 1 commit into
google:mainfrom
AAliKKhan:fix/duplicate-snippet-region
Open

AAliKKhan wants to merge 1 commit into
google:mainfrom
AAliKKhan:fix/duplicate-snippet-region

Conversation

@AAliKKhan

Copy link
Copy Markdown
Contributor

Problem

MultiAgentExample.kt defines the region name human_in_loop_pattern twice
— two start markers and two end markers:

Lines What the region contains
50–70 class ExternalApprovalTool : BaseTool(…) — the approval tool
353–392 prepareRequest / requestApproval / processDecision → SequentialAgent HumanApprovalWorkflow — the workflow

pymdownx.snippets resolves a region at the first matching start marker, so
the second definition is unreachable. docs/workflows/patterns.md:967 is the
only page that references this region, and it gets the wrong block.

The effect is a broken "Human in the loop" section. Rendering that page, three
of the four language tabs show the workflow and only Kotlin does not:

Tab Published content
Python LlmAgent, SequentialAgent, FunctionTool
TypeScript LlmAgent, SequentialAgent, FunctionTool
Java LlmAgent, SequentialAgent, approvalWorkflow
Kotlin class ExternalApprovalTool : BaseTool( — no agents, no workflow

Confirmed against the built site: the Kotlin <pre> block is the tool class,
while the neighbouring Java block is the SequentialAgent composition.

Fix

Rename the first region — the supporting tool class — to human_in_loop_tool,
so human_in_loop_pattern unambiguously resolves to the workflow. The tool
class remains addressable for anyone who wants it, and patterns.md needs no
change.

Verification

Render-based suite (verify_batch7.py): 24/24 pass

  • …kt:human_in_loop_pattern now renders SequentialAgent +
    HumanApprovalWorkflow, and no longer contains class ExternalApprovalTool : BaseTool
  • …kt:human_in_loop_tool still renders the tool class
  • every region in the file has balanced start / end markers

A structural scan of all 271 example files covering 612 region markers
finds 3 problems, of which this is one. (One other is already covered by
#2450; the third turned out to be a false positive — pymdownx tolerates a
space inside [start: …].)

mkdocs build --strict on the union of this round's four branches:
exit 0, 0 warnings.

MultiAgentExample.kt defines the region name human_in_loop_pattern twice,
with two start markers and two end markers:

  lines 50-70    class ExternalApprovalTool : BaseTool(...)  - the tool
  lines 353-392  prepareRequest / requestApproval / processDecision ->
                 SequentialAgent HumanApprovalWorkflow        - the workflow

pymdownx.snippets resolves a region at the first matching start marker, so the
second definition is unreachable. docs/workflows/patterns.md:967 is the only
page referencing this region, and it receives the wrong block.

The published "Human in the loop" section is therefore inconsistent across
language tabs - Python, TypeScript and Java all show the workflow composition,
while Kotlin alone shows the tool class with no agents and no workflow.

Rename the first region, the supporting tool class, to human_in_loop_tool so
that human_in_loop_pattern unambiguously resolves to the workflow. The tool
class stays addressable, and patterns.md needs no change.

Verified with a render-based suite (24/24): the pattern region now renders
SequentialAgent + HumanApprovalWorkflow and no longer contains the tool class,
the tool region still renders the class, and every region in the file has
balanced start/end markers.
@netlify

netlify Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for adk-docs-preview ready!

Name Link
🔨 Latest commit 48761af
🔍 Latest deploy log https://app.netlify.com/projects/adk-docs-preview/deploys/6adba16678c86f994d462b73
😎 Deploy Preview https://deploy-preview-2488--adk-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant