Commit e845f95
committed
fix(flows): scope skip_summarization text-append to AgentTool
PR #5974 (issue #3881) added a text part to the function-response event when
skip_summarization is True, so an AgentTool's output stays visible in UIs that
do not render function responses. The condition was not guarded by tool type,
so it fires for every tool that sets skip_summarization.
Tools other than AgentTool set skip_summarization for the opposite reason:
their function response is an internal acknowledgement (e.g. a UI/widget tool
returning {"status": "ok"}) that should not be summarized or shown to the
user. Force-converting that ack into a text Part makes it bypass UI/SSE
filters that only strip functionResponse/functionCall/thought parts, so the
raw payload is surfaced to the user as visible text.
Scope the append to AgentTool via isinstance, matching the original change's
stated intent (issue #3881 is specifically about AgentTool). AgentTool keeps
its text output; other tools no longer have their function response duplicated
as text. AgentTool is imported lazily to avoid the
agents -> flows -> tools -> agents circular import.
Adds a regression test: a non-AgentTool with skip_summarization=True produces
only a function_response part and no text part. The existing AgentTool
skip_summarization tests continue to pass.1 parent 50c81eb commit e845f95
2 files changed
Lines changed: 57 additions & 6 deletions
File tree
- src/google/adk/flows/llm_flows
- tests/unittests/flows/llm_flows
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1202 | 1202 | | |
1203 | 1203 | | |
1204 | 1204 | | |
1205 | | - | |
1206 | | - | |
1207 | | - | |
1208 | | - | |
1209 | | - | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
1210 | 1219 | | |
1211 | 1220 | | |
1212 | 1221 | | |
1213 | 1222 | | |
1214 | | - | |
| 1223 | + | |
| 1224 | + | |
1215 | 1225 | | |
1216 | 1226 | | |
1217 | 1227 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1623 | 1623 | | |
1624 | 1624 | | |
1625 | 1625 | | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
1626 | 1667 | | |
1627 | 1668 | | |
1628 | 1669 | | |
| |||
0 commit comments