Skip to content

fix(adk): honor subagent tool description and name customizations - #1372

Draft
N3kox wants to merge 1 commit into
alpha/10from
fix/alpha10-m22-002-003
Draft

N3kox wants to merge 1 commit into
alpha/10from
fix/alpha10-m22-002-003

Conversation

@N3kox

@N3kox N3kox commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

fix

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. https://github.com/cloudwego/cloudwego.github.io

(Optional) Translate the PR title into Chinese.

修复 ADK 子智能体工具描述和工具名称自定义不生效的问题。

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en:

This PR fixes two customization regressions in the subagent middleware and Deep Agent integration.

First, ToolDescriptionGenerator and Deep Agent's TaskToolDescriptionGenerator are documented to return a complete tool description. Their returned text was previously passed through pyfmt again, causing valid descriptions containing JSON, code snippets, or ordinary braces to fail during agent construction.

The generated description is now used verbatim. Framework-controlled placeholders are rendered only for the built-in description.

Second, setting ToolName changed the registered tool name but left the built-in system prompt, tool description, background instructions, and agent-type reminder hardcoded to agent. For example, Deep Agent registered a task tool while instructing the model to call agent.

The built-in model-facing text now consistently uses the effective tool name across:

  • System prompts.
  • Tool descriptions.
  • Background execution instructions.
  • Available-agent reminders.
  • English and Chinese prompts.
  • schema.Message and schema.AgenticMessage.

Caller-provided descriptions, system prompts, and reminders remain unchanged and are not interpreted as templates.

zh(optional):

(Optional) Which issue(s) this PR fixes:

N/A. Fixes internal review findings M22-002 and M22-003.

(optional) The PR that updates user documentation:

N/A. This PR restores the documented customization behavior without introducing a usage-level API change.

@codecov

codecov Bot commented Oct 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (alpha/10@58daeda). Learn more about missing BASE report.

Additional details and impacted files
@@             Coverage Diff             @@
##             alpha/10    #1372   +/-   ##
===========================================
  Coverage            ?   81.92%           
===========================================
  Files               ?      216           
  Lines               ?    36843           
  Branches            ?        0           
===========================================
  Hits                ?    30184           
  Misses              ?     4492           
  Partials            ?     2167           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant