Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: a2aproject/a2a-python
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.1.1
Choose a base ref
...
head repository: a2aproject/a2a-python
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.1.2
Choose a head ref
  • 4 commits
  • 10 files changed
  • 5 contributors

Commits on Jul 20, 2026

  1. fix: persist early producer failure as FAILED with originating message (

    #1106)
    
    Fixes #1067
    
    ## Summary
    - seed the originating message into V2 ActiveTask TaskManager creation
    so newly created fallback tasks retain request history
    - synchronously persist TASK_STATE_FAILED from _run_producer when
    producer setup/execution raises, so persistence does not depend on the
    closing event queue
    - avoid appending the seeded originating message a second time when the
    first task update also carries it
    
    ## Tests
    - ./scripts/lint.sh
    - uv run pytest
    tests/server/request_handlers/test_default_request_handler_v2.py::test_on_message_send_early_producer_exception_marks_task_failed
    tests/server/request_handlers/test_default_request_handler_v2.py::test_on_message_send_early_producer_exception_preserves_originating_message
    - uv run pytest
    tests/server/request_handlers/test_default_request_handler_v2.py
    
    ---------
    
    Co-authored-by: mykytanetipa <mykytanetipa@google.com>
    AXEG0 and mykytanetipa authored Jul 20, 2026
    Configuration menu
    Copy the full SHA
    4e3d724 View commit details
    Browse the repository at this point in the history
  2. fix(agent_execution): resolve ActiveTask 'destroyed but pending' warn…

    …ing during teardown (#1122)
    
    Fixes #1121. This PR resolves the issue where `ActiveTask` would throw
    an asyncio warning when being garbage collected, by ensuring the
    `_producer_task` is properly awaited during the `_run_consumer` teardown
    path, allowing queues to properly close without leaving dangling pending
    background tasks.
    
    ---------
    
    Co-authored-by: mykytanetipa <mykytanetipa@google.com>
    arunmm8335 and mykytanetipa authored Jul 20, 2026
    Configuration menu
    Copy the full SHA
    d19c4d2 View commit details
    Browse the repository at this point in the history
  3. feat(server): add aclose() to drain ActiveTask background tasks (#1101)…

    … (#1105)
    
    ## Summary
    
    Adds a public `aclose()` teardown to `ActiveTask`, `ActiveTaskRegistry`,
    and
    `DefaultRequestHandlerV2` that force-drains the SDK-owned producer,
    consumer,
    and dispatcher `asyncio.Task`s so none are left pending at event-loop
    shutdown.
    
    - `ActiveTask.aclose()` force-closes both event queues and cancels the
    producer
    and consumer tasks, then awaits them. It sets `_is_finished` under
    `_lock`, so
      it is mutually exclusive with `start()` (which refuses to spawn once
      `_is_finished` is set).
    - `ActiveTaskRegistry.aclose()` marks the registry closed so
    `get_or_create`
      refuses new work, drains every active task, then awaits the in-flight
    `_remove_task` cleanup tasks. The lock is released before awaiting
    because
      `_remove_task` re-acquires it.
    - `DefaultRequestHandlerV2.aclose()` delegates to the registry drain,
    for wiring
      into an ASGI `lifespan` / `on_shutdown` hook.
    
    ## Why
    
    Fixes #1101. At shutdown the `ActiveTask` producer can stay pending and
    surface
    as `Task was destroyed but it is pending!`. The producer's `finally`
    calls
    `_event_queue_subscribers.close(immediate=False)`, which awaits `join()`
    on
    every subscriber sink; an abandoned subscriber leaves an undrained sink,
    so the
    `join()` never returns and the producer hangs. There is no public way to
    drain
    these background tasks today. `aclose()` closes the queues with
    `immediate=True`,
    which releases the wedged producer, and reaps the tasks.
    
    The teardown always forces rather than exposing a graceful
    `immediate=False`
    option, because that path inherits the documented
    `close(immediate=False)`
    deadlock and a shutdown hook must be bounded.
    
    ## Test plan
    
    - [x] `uv run pytest tests/server/agent_execution/
    tests/server/request_handlers/ tests/server/events/` — pass
    - [x] `uv run pytest --cov=a2a --cov-fail-under=88` — pass
    - [x] `./scripts/lint.sh` — ruff, ruff-format, and ty clean
    
    New tests cover the registry drain, idempotency, empty registry,
    new-work
    rejected after close, and an errored task being logged rather than
    propagated;
    `ActiveTask` reaping a running producer and force-closing past an
    undrained
    subscriber (the #1101 repro); and the handler drain.
    
    Fixes #1101 🦕
    astrogilda authored Jul 20, 2026
    Configuration menu
    Copy the full SHA
    9801f46 View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2026

  1. chore(main): release 1.1.2 (#1139)

    🤖 I have created a release *beep* *boop*
    ---
    
    
    ##
    [1.1.2](v1.1.1...v1.1.2)
    (2026-07-20)
    
    
    ### Features
    
    * **server:** add aclose() to drain ActiveTask background tasks
    ([#1101](#1101))
    ([#1105](#1105))
    ([9801f46](9801f46))
    
    
    ### Bug Fixes
    
    * **agent_execution:** resolve ActiveTask 'destroyed but pending'
    warning during teardown
    ([#1122](#1122))
    ([d19c4d2](d19c4d2))
    * persist early producer failure as FAILED with originating message
    ([#1106](#1106))
    ([4e3d724](4e3d724))
    
    ---
    This PR was generated with [Release
    Please](https://github.com/googleapis/release-please). See
    [documentation](https://github.com/googleapis/release-please#release-please).
    a2a-bot authored Jul 22, 2026
    Configuration menu
    Copy the full SHA
    3e6fa6a View commit details
    Browse the repository at this point in the history
Loading