4 Commits

Author SHA1 Message Date
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