33 Commits

Author SHA1 Message Date
George Weale 7c7d2baec4 docs: repair the workflow guides and document BaseNode
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 970160544
2026-08-24 16:42:19 -07:00
George Weale d8df6fd1fe fix(workflow): honor START as a satisfied JoinNode predecessor
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 970004551
2026-08-24 12:24:23 -07:00
Shangjie Chen 1d89e0ff8d docs(guides): add developer unit guide for Runner and Runner Live Streaming
Add granular developer guide for BaseRunner and InMemoryRunner covering session
lifecycle resolution, RunConfig, and event streaming under
docs/guides/runners/runner/index.md, and real-time bidirectional streaming with
run_live and LiveRequestQueue under docs/guides/runners/runner/live.md.

Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 968085075
2026-08-20 15:18:44 -07:00
Dani Zamora 17cb2657ce docs: add audio_stream_end documentation for realtime input
Merge https://github.com/google/adk-python/pull/6768

PiperOrigin-RevId: 967479785
2026-08-19 16:54:13 -07:00
Shangjie Chen b370fc00d1 docs(guides): add developer unit guide for BaseCodeExecutor
Add granular developer guide for BaseCodeExecutor covering architecture,
execution flow, backend environments (BuiltIn, UnsafeLocal, Container,
GKE gVisor, Vertex AI, Agent Engine), delimiter extraction, and error
retry loops under docs/guides/code_executors/code_executor/index.md.

Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 967423934
2026-08-19 14:54:33 -07:00
Shangjie Chen ea23a89d73 docs(guides): add developer unit guide for BasePlanner
Add granular developer guide for BasePlanner covering planning system
instructions, ThinkingConfig integration, PlanReActPlanner structured
reasoning tags, and thought partitioning under
docs/guides/planners/planner/index.md.

Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 967402627
2026-08-19 14:12:50 -07:00
George Weale 576d5678b1 chore(docs): add the missing trailing newline to the task mode guide
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 966172508
2026-08-17 14:09:13 -07:00
Google Team Member 72f3ff5cfb feat(a2a): add native task mode support to RemoteA2aAgent
- Support mode="task" in RemoteA2aAgent to natively execute task-oriented tools.
- Ensure RemoteA2aAgent in task mode registers the finish_task tool definition.
- Fix task scope aggregation during delegation using a two-pass active task scope search in the runner.
- Correctly map terminal states and status values inside A2aAgentExecutor.

PiperOrigin-RevId: 964898667
2026-08-14 14:43:58 -07:00
George Weale d24ec83ccd docs: add App unit guide
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 963717883
2026-08-12 16:19:40 -07:00
George Weale 5a2a59b74f docs: add session State unit guide
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 963711846
2026-08-12 16:07:55 -07:00
George Weale 78a4ee2c69 docs: add tool authentication unit guide
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 963703932
2026-08-12 15:52:46 -07:00
George Weale b8c099d37f docs: add artifact service unit guide
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 963673192
2026-08-12 14:50:26 -07:00
George Weale 2353dde8e9 docs: add model registry unit guide
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 963549916
2026-08-12 11:07:29 -07:00
George Weale 3df5a6519a docs: add Session unit guide
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 962458183
2026-08-10 17:25:52 -07:00
George Weale aac410a66f docs: add memory service unit guide
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 962403306
2026-08-10 15:33:02 -07:00
Jason Zhang 0c79d1a8da refactor(samples): Rename plugin folder to plugins for consistency
Rename `contributing/samples/plugin/` to `contributing/samples/plugins/` so the
samples directory matches the `plugins/` naming already used everywhere else in
the repository for this feature area: the `google.adk.plugins` source package
(`src/google/adk/plugins/`), the guide at `docs/guides/plugins/`, and the unit
tests at `tests/unittests/plugins/`. It also matches the plural naming used by
every sibling sample group (`tools/`, `models/`, `workflows/`, `patterns/`, and
others). The moved files themselves are unchanged.

Also update the paths that pointed into the renamed directory:

- Repoint the two "Related samples" links in the reflect-and-retry tool plugin
  guide, which the move would otherwise break.
- Fix the run commands in the two sample READMEs and in the debug logging agent
  docstring. These already omitted the grouping directory and so did not work
  before the rename either; they now refer to paths that exist.

Co-authored-by: Jason Zhang <jasoncz@google.com>
PiperOrigin-RevId: 960009471
2026-08-05 19:52:21 -07:00
Lalit Kumar 5647699993 docs: fix mcp sample link
Merge https://github.com/google/adk-python/pull/6492

Closes: #6490
PiperOrigin-RevId: 959796380
2026-08-05 12:09:47 -07:00
Jason Zhang 94832a5151 docs: Add developer unit guide for ReflectAndRetryToolPlugin
The new guide explains what the plugin does, a get-started
example, how the retry loop and per-tool failure tracking
work, the configuration options, advanced applications,
and its limitations.

Co-authored-by: Jason Zhang <jasoncz@google.com>
PiperOrigin-RevId: 955444373
2026-07-28 13:40:52 -07:00
Haran Rajkumar 52c3e9eb60 docs: document creating and using a custom managed agent
Add a "Create and use a custom managed agent" section to the ManagedAgent guide
showing the control-plane create/delete pattern via `ManagedAgent.api_client`,
and complete the guide's Related samples list.

Co-authored-by: Haran Rajkumar <haranrk@google.com>
PiperOrigin-RevId: 954766292
2026-07-27 12:25:10 -07:00
Jason Zhang 322f45591c feat: Add ReflectAndRetryModelPlugin for self-healing model errors
Introduces the `ReflectAndRetryModelPlugin`, which provides error recovery
for model failures (such as malformed function calls). When a configured model
error occurs, the plugin intercepts it, provides reflection guidance to
the model via a reserved tool call, and retries the operation.

Key features:
- Configurable max retries for model errors.
- Customizable list of FinishReasons to treat as errors.
- Support for both invocation-level and global-level tracking scopes.
- Interception of direct calls to the reserved retry tool to prevent misuse.

Co-authored-by: Jason Zhang <jasoncz@google.com>
PiperOrigin-RevId: 954695655
2026-07-27 10:15:36 -07:00
Haran Rajkumar 597fac3a4f docs(agents): add system-instruction sample and guide section
Add a runnable sample under
contributing/samples/managed_agent/system_instruction demonstrating the new
ManagedAgent.instruction field, and document the field in the ManagedAgent
guide.

Co-authored-by: Haran Rajkumar <haranrk@google.com>
PiperOrigin-RevId: 951709300
2026-07-21 14:46:43 -07:00
Haran Rajkumar 26ed6fe382 docs(guides): note single_turn works for non-LlmAgent agents
Extend the LlmAgent single-turn guide with a section showing that `single_turn`
composition is not limited to `LlmAgent`: a server-backed `ManagedAgent` can be
a single-turn sub-agent via `mode='single_turn'`, is auto-exposed as an inline
tool, preserves its internal events in the shared session, and is stateless per
call.

Co-authored-by: Haran Rajkumar <haranrk@google.com>
PiperOrigin-RevId: 945962977
2026-07-10 17:10:18 -07:00
Shangjie Chen 9d306f5d32 feat(workflow): Support state-based resumption for task-mode agent workflow nodes
- Decouple task-mode node execution from default output binding so standard text output does not prematurely finish the node.
- Enhance the runner to automatically resolve and reuse the invocation_id of active suspended task nodes.
- Route incoming plain text resume messages to the active task node by mapping to its isolation scope.
- Enforce strict concurrency serialization by suspending parallel branch execution when a task node is waiting for user input.
- Align schema validation helpers to cleanly handle Content wrapping and raw JSON strings.

Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 945423735
2026-07-09 18:40:44 -07:00
George Weale 534e8d50cc docs: add to_mcp_server unit guide
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 944717677
2026-07-08 14:59:25 -07:00
Haran Rajkumar ab839d51d3 docs(guides): Add ManagedAgent unit guide
This guide explains how to use ManagedAgent, its configuration
options, and orchestrating it with AgentTool.

Co-authored-by: Haran Rajkumar <haranrk@google.com>
PiperOrigin-RevId: 944359273
2026-07-08 02:03:47 -07:00
Shangjie Chen 199d954815 feat: expose max_parallel_workers parameter on workflow.node decorator and Node class
Expose `max_parallel_workers` on the `@workflow.node` decorator and `Node` class when `parallel_worker=True`. This allows throttling the concurrency limit when executing parallel workers.

Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 940663519
2026-06-30 14:34:30 -07:00
Bo Yang a40f19930f fix: Wrap math formulas in math blocks in retry config guide
This ensures proper rendering of the delay and jitter formulas.

Co-authored-by: Bo Yang <ybo@google.com>
PiperOrigin-RevId: 934409270
2026-06-18 09:54:25 -07:00
George Weale a7377b446a docs: remove trailing whitespace in dynamic_nodes guide
Unblocks the pre-commit --all-files check; mdformat rewrites this file
and fails on every PR until the whitespace is gone.

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 934144935
2026-06-17 23:29:05 -07:00
Bo Yang e5c7d20d5d docs(workflow): Add and update workflow developer guides
Add comprehensive guides explaining:
- Workflow Graphs (nodes, edges, validation)
- Function Nodes (wrapping functions and generators)
- Join Nodes (aggregating parallel branches)
- Retry Config (resilience policies)
- Parallel Workers (concurrent list processing)
- Dynamic Nodes (runtime execution)

Update the main guides index and the adk-unit-guide skill rules.

Co-authored-by: Bo Yang <ybo@google.com>
PiperOrigin-RevId: 933979245
2026-06-17 16:15:57 -07:00
Bo Yang f84a5b5e20 docs: add unit guides for task mode
Added task mode doc, README and cross-linking samples.

Co-authored-by: Bo Yang <ybo@google.com>
PiperOrigin-RevId: 931386773
2026-06-12 16:19:07 -07:00
Bo Yang 7d74a0a0e2 docs: add unit guides for event.py, request_input.py and update adk-unit-guide skill
- Updated request_input.py unit guide to use function node example and removed field table.
- Updated adk-unit-guide skill:
  - Discourage exhaustive API reference tables in guides.
  - Prefer simple Python functions over extending BaseNode for workflow node samples.
- Removed field reference tables from the event guide.

Co-authored-by: Bo Yang <ybo@google.com>
PiperOrigin-RevId: 931347184
2026-06-12 14:55:34 -07:00
George Weale cb48d015d8 fix: restore GitHub-only changes dropped during v2 bring-over
Re-aligns two files with GitHub main so the piper-to-github cutover does not
silently revert them: the _ALLOWED_PICKLE_GLOBALS type annotation and a stray
f-string prefix in skill_toolset.

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 928768999
2026-06-08 16:49:54 -07:00
Bo Yang 6a533573db feat(api_server): Abort runs on client drops to avoid leaks
Standard REST, SSE, and WebSocket endpoints now actively monitor client disconnections. When a connection drop is intercepted, the executing worker task tree is aborted mid-run to prevent background task leaks, API token burn, and resource wastage.

Includes:
1. REST `/run` connection drop monitor blocking on raw ASGI receive events with 0% CPU consumption.
2. Graceful `499 Client Closed Request` status response on REST disconnections to suppress server-side exceptions.
3. Unit and integration tests validating REST task cancellations and generator finalizations.
4. Comprehensive architectural design documents and user guide under `/docs`.
5. An invocation-focused cooperative counting agent sandbox under `/contributing/samples/core/abort`.

Change-Id: I50fcba7a8bb56cf28b0a3bb8fa66b85732062a67
2026-05-28 14:11:39 -07:00