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: v0.3.6
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: v0.3.7
Choose a head ref
  • 3 commits
  • 7 files changed
  • 3 contributors

Commits on Sep 17, 2025

  1. fix: Task state is not persisted to task store after client disconnect (

    #472)
    
    # Issue
    It's been described well in #464 :
    
    > When the client-side connection is terminated, the EventConsumer stops
    processing. As a result, any changes to the task state after the
    disconnection are not persisted to the TaskStore. The task itself
    continues running in the background, but its updated state is no longer
    reflected in the TaskStore.
    
    This has been addressed in this PR by simply adding a catch for
    `(asyncio.CancelledError, GeneratorExit)` in the
    `on_message_send_stream` method.
    
    However, adding that revealed a difference in semantics between Python
    3.13+ and <3.13 for `EventQueue.close()`. I have also addressed that.
    
    # How it's reproduced
    
    [@azyobuzin](https://github.com/azyobuzin) provided a detailed guide on
    this in #464 . My only addition would be to add loggers for
    `a2a.server.events.event_queue` and `a2a.server.events.event_consumer`
    to get a better understanding of what's happening under the hood.
    
    # Fix
    
    ## Code
    
    - Ensure streaming continues persisting events after client disconnect
    via background consumption by adding a catch for
    `(asyncio.CancelledError, GeneratorExit)` in the
    `on_message_send_stream` method.
    - Align EventQueue.close() behavior on Python ≥3.13 and ≤3.12 (graceful
    vs. immediate).
    
    ## Tests
    
    ### Event queue tests (`tests/server/events/test_event_queue.py`)
    Added/updated tests to verify:
    
    - Graceful close on ≥3.13 waits for drain and children.
    - Immediate close clears queues and propagates.
    - To support Python 3.10, when simulating ≥3.13 using sys.version_info,
    inject a dummy queue.shutdown on asyncio.Queue so tests don’t fail on
    runtimes without it. I've seen this pattern used in existing tests too.
    
    ### Request handler tests
    (`tests/server/request_handlers/test_default_request_handler.py`)
    Added `test_disconnect_persists_final_task_to_store` which tests the
    flow described in issue #464 :
    
    - Starts streaming, yields first event, then simulates client
    disconnect.
    - Background consumer persists the final Task to `InMemoryTaskStore`.
    - Uses `wait_until` to await disappearance of the specific
    `background_consume:{task_id}` task, then asserts `TaskState.completed`.
    
    ### General
    Added a cleanup for lingering background tasks, I think it's an
    improvement for my earlier PR where I've tracked background tasks.
    
    
    # Misc
    Ruff `0.13.0` now fails the check for unused variables, made some
    minimal changes as suggested by the linter, irrelevant to the issue:
    underscores for `_payload` and `_task_manager`.
    
    
    Fixes #464
    ovidiutaralesca authored Sep 17, 2025
    Configuration menu
    Copy the full SHA
    5342ca4 View commit details
    Browse the repository at this point in the history

Commits on Sep 22, 2025

  1. fix: jsonrpc client send streaming request header and timeout field (#…

    …475)
    
    The underlying `aconnect_sse` library will overwrite the header and
    timeout of what's set in the `httpx_client`.
    
    From a user using adk `a2a_remote_agent` library, they would pass in these
    information in the `httpx_client`. I have tried this fix in my local
    setup.
    cyy12345 authored Sep 22, 2025
    Configuration menu
    Copy the full SHA
    675354a View commit details
    Browse the repository at this point in the history

Commits on Sep 23, 2025

  1. chore(main): release 0.3.7 (#474)

    🤖 I have created a release *beep* *boop*
    ---
    
    
    ##
    [0.3.7](v0.3.6...v0.3.7)
    (2025-09-22)
    
    
    ### Bug Fixes
    
    * jsonrpc client send streaming request header and timeout field
    ([#475](#475))
    ([675354a](675354a))
    * Task state is not persisted to task store after client disconnect
    ([#472](#472))
    ([5342ca4](5342ca4)),
    closes [#464](#464)
    
    ---
    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 Sep 23, 2025
    Configuration menu
    Copy the full SHA
    4a4b4a9 View commit details
    Browse the repository at this point in the history
Loading