Repository navigation
Comparing changes
Open a pull request
base repository: a2aproject/a2a-python
base: v1.2.2
head repository: a2aproject/a2a-python
compare: v1.2.3
- 16 commits
- 38 files changed
- 19 contributors
Commits on Oct 5, 2026
-
fix(jcs): count open containers for the nesting bound, so an empty co…
…ntainer leaf is refused (#1294) ## What `_jcs.canonicalize` bounds nesting at `MAX_DEPTH = 128`, but the counter tracks **values on the path** (0-based) rather than **open containers** (outermost at 1). An empty container is therefore accepted one level past the bound, while the same shape wrapped around a scalar is refused — the effective limit depends on what the innermost value is. This counts open containers instead, and applies the same rule to `signing._clean_empty`, which runs **before** canonicalization and would otherwise be the exhaustion path. ## Why `jcs_depth_v1` (a2aproject/A2A#2246) pins eight inputs and their verdicts; it is added here as `tests/utils/jcs_depth_vectors.json`, retained as published with attribution. On the current code the empty-container case is mis-accepted: | vector | depth | expected | before | after | |---|---|---|---|---| | `jcs-depth-001` … `-004` | 128 | accept | bytes | bytes | | `jcs-depth-101`, `-102` | 129 | reject | `CanonicalizationError` | `CanonicalizationError` | | `jcs-depth-103` (empty-container leaf) | 129 | reject | **bytes returned** | `CanonicalizationError` | | `jcs-depth-104` | 10⁷ | reject | `RecursionError`, at the decode | `RecursionError`, at the decode | `jcs-depth-104` never reaches the walk: the JSON decoder refuses that input first, in both trees. The test accepts either refusal, as the vector asks, rather than claiming the canonicalizer produced it. The intended rule is already written down in this repo — the docstring of `test_nesting_at_the_limit_is_accepted` says "the deepest container is at depth n + 1", i.e. containers with the outermost at 1 — so this makes the implementation match its own stated intent, and that boundary test keeps passing unchanged. ## Tests * `tests/utils/test_jcs.py` gains the corpus-driven tests: every preimage digest checked **before** any expectation is used; accepts compared byte-for-byte against the published bytes and SHA-256; rejects asserted to raise; plus a direct empty-container boundary pair and the same pair through `_clean_empty`. * Without the fix: **3 failed, 180 passed** (the two empty-container cases and the pre-pass case). With it: **205 passed**, `test_jcs.py` and `test_signing.py` both green. * `ruff check` and `ruff format --check` clean on all four files. ## Scope Independent of a2aproject/A2A#2122 and of #1287, which are about canonicalization *scope*, not the nesting bound. Nothing at or below the bound changes: the 24 cards in a2aproject/a2a-tck#246 canonicalize byte-identically before and after. Reported at a2aproject/A2A#2255. Corpus authored by Sankalp Gilda (Apache-2.0); the JSON keeps the upstream pointer and states that every expected byte string came from the reference implementation it names. Co-authored-by: mykytanetipa <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5653daf - Browse repository at this point
Copy the full SHA 5653dafView commit details -
fix(client): normalize malformed agent card parsing errors (#1307)
## Description When an agent-card endpoint returns HTTP 200 with valid JSON such as `null`, an array, a string, a number, or a boolean, the compatibility helpers raise `AttributeError` or `TypeError`. Malformed nested legacy fields can raise the same exceptions even when the root is an object. These exceptions escape `A2ACardResolver.get_agent_card()` instead of the documented `AgentCardResolutionError`. Validate that the decoded value is a JSON object at the parser boundary. Convert `TypeError` and `AttributeError` from the three compatibility helpers into `ParseError`, retaining their original cause. The resolver already wraps `ParseError` into `AgentCardResolutionError`; protobuf parsing and signature verification retain their existing exception handling. Regression tests use `httpx.MockTransport` with real JSON decoding: eight non-object roots and all six malformed nested cases from the review (null/list capabilities, a null additional interface, null skills/a null skill, and string security). Every new case failed before its corresponding fix. The nested-field tests also verify the full exception cause chain. ## Validation - The Windows equivalents of `scripts/lint.sh` (`uv run --locked ruff check --fix`, `ruff format`, and `ty check`) passed. `ty` exits successfully with three existing unused-ignore warnings. - `uv run --locked pytest tests/client/test_card_resolver.py -q`: **46 passed**. - `uv run --locked pytest --ignore=tests/integration --cov=src --cov-report=term-missing -q`: **1,788 passed, 169 skipped, 3 xfailed; 91% coverage**. `card_resolver.py` has **100% statement and branch coverage**. - With `PYTHONIOENCODING=utf-8`, sample integration smoke tests: **3 passed**. - Full pytest was attempted on Windows and timed out in scenario integration tests. A coverage run excluding only the scenario and sample modules completed with **2,095 passed, 183 skipped, 3 xfailed and 8 fixture errors; 93% coverage**. The errors are in the previously problematic cross-version server fixtures (startup / unavailable `os.killpg`) and push-notification fixtures (a FastAPI local callable cannot be pickled under Windows multiprocessing). These platform limitations are outside this change. - Updated GitHub Actions checks all passed, including the full Python 3.10–3.14 matrix, ACTS, ITK, lint and install checks. The same matrix also passed before this follow-up. AI assistance: OpenAI Codex (GPT-6) was used to implement, reproduce, and test this change under the account owner's explicit authorization. The follow-up implements the human maintainer's review request and received another independent review before submission. - [x] Followed the contributing guide and conventional-commit title format. - [x] Added failing regression cases and ran lint, formatting, type and coverage checks. --------- Co-authored-by: mykytanetipa <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 486f0f6 - Browse repository at this point
Copy the full SHA 486f0f6View commit details -
fix(telemetry): let trace_function alone decide a span's status (#1309)
# Description `trace_function` opened its span with `start_as_current_span`'s defaults (`record_exception=True`, `set_status_on_exception=True`). OTel's `use_span` therefore recorded any `Exception` leaving the block and marked the span `ERROR`, on top of what the wrapper had already done: - `QueueShutDown` still ended as `ERROR` on every queue teardown, even though #1075 treats it as a non-error. In practice that is one `ERROR` `EventQueueSource.dequeue_event` span per streaming request. - Every exception was recorded twice on the span, and OTel's `Type: message` description replaced the wrapper's `str(e)`. ## Change - `src/a2a/utils/telemetry.py`: pass `record_exception=False, set_status_on_exception=False` to `start_as_current_span` in both the async and the sync wrapper. The wrapper already records the exception and sets the status itself. - `tests/utils/test_telemetry.py`: add `test_span_status_with_real_otel_sdk`. It goes through a real `TracerProvider` + `InMemorySpanExporter`, because the existing mocked tracer can't see what OTel does on exit. It is parametrized over: - `QueueShutDown`, expected not `ERROR`; - `ValueError`, expected `ERROR`. Both cases check that the span has exactly one `exception` event. Both fail on `main` and pass with this change. ## Before / after The reproduction script from #1308 (a2a-sdk `main` at 6ff0a82, opentelemetry-sdk 1.42.1): ``` # before shutdown ERROR 'AsyncQueueShutDown: ' ['exception', 'exception'] boom ERROR 'ValueError: real failure' ['exception', 'exception'] # after shutdown UNSET None ['exception'] boom ERROR 'real failure' ['exception'] ``` ## Checks - `./scripts/lint.sh`: ruff check, ruff format and ty all pass. - `uv run pytest --cov=src`: 2206 passed, 93 % coverage. - **Pre-existing failure:** `tests/integration/cross_version/client_server/test_client_server.py` fails locally on `main` too, without this change (the 0.3 server/client subprocess doesn't start on my machine). This PR doesn't touch it. - [x] Follow the [`CONTRIBUTING` Guide](https://github.com/a2aproject/a2a-python/blob/main/CONTRIBUTING.md). - [x] Make your Pull Request title in the <https://www.conventionalcommits.org/> specification. - [x] Ensure the tests and linter pass (Run `bash scripts/format.sh` from the repository root to format) - [x] Appropriate docs were updated (if necessary) Fixes #1308 🦕 Co-authored-by: Atenea Agent @svc_atenea_gitlab Co-authored-by: mykytanetipa <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 59dcbfb - Browse repository at this point
Copy the full SHA 59dcbfbView commit details
Commits on Oct 6, 2026
-
fix(server): run follow-up messages in the sender's contextvars (#1317)
# Description `ActiveTask` creates its producer once, during the first request for a task. Later messages on the same task are queued to that producer, so `AgentExecutor.execute()` ran with the **first** request's contextvars. Per-request values set by ASGI middleware or a `ServerCallContextBuilder` (auth tokens, tenant identity, tracing) were stale on every follow-up turn, for example a reply after `input-required`. This change captures `contextvars.copy_context()` in `enqueue_request()`, which runs in the sender's request, and runs `execute()` in that context as a child task. Awaiting the child keeps cancellation working, because cancelling the producer cancels the child. `Context.run(asyncio.create_task, ...)` works on Python 3.10. Only `execute()` changes context. Task-store writes and push notifications still run in the producer's context, as before. Tested: - New `test_follow_up_message_runs_in_sender_contextvars`, for both `on_message_send` and `on_message_send_stream`. It fails on `main` and passes with this change. - The reproduction in #1316 prints `request-2` for the follow-up. - `./scripts/lint.sh` passes. `uv run pytest --cov=src` gives 2223 passed, 93% coverage. `tests/integration/cross_version/client_server/test_client_server.py` was deselected because its server fails to start in my local environment on `main` too. - [x] Follow the [`CONTRIBUTING` Guide](https://github.com/a2aproject/a2a-python/blob/main/CONTRIBUTING.md). - [x] Make your Pull Request title in the <https://www.conventionalcommits.org/> specification. - [x] Ensure the tests and linter pass (Run `bash scripts/format.sh` from the repository root to format) - [x] Appropriate docs were updated (if necessary) Fixes #1316 🦕 Co-authored-by: mykytanetipa <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a016002 - Browse repository at this point
Copy the full SHA a016002View commit details -
chore(deps-dev): bump pyjwt from 2.15.0 to 2.15.1 (#1310)
Bumps [pyjwt](https://github.com/jpadilla/pyjwt) from 2.15.0 to 2.15.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/jpadilla/pyjwt/releases">pyjwt's releases</a>.</em></p> <blockquote> <h2>2.15.1</h2> <p>See the <a href="https://github.com/jpadilla/pyjwt/blob/2.15.1/CHANGELOG.rst">2.15.1 changelog</a> for complete release details.</p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/jpadilla/pyjwt/blob/master/CHANGELOG.rst">pyjwt's changelog</a>.</em></p> <blockquote> <h2><code>v2.15.1 <https://github.com/jpadilla/pyjwt/compare/2.15.0...2.15.1></code>__</h2> <p>Fixed</p> <pre><code> - Accept trailing Base64URL ``=`` padding when decoding JWS segments, so tokens issued by AWS ALB and similar systems verify instead of raising ``DecodeError: Invalid crypto padding``. Non-alphabet junk such as ``!!!!`` remains rejected (`[#1209](jpadilla/pyjwt#1209) <https://github.com/jpadilla/pyjwt/issues/1209>`__). </code></pre> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/jpadilla/pyjwt/commit/7d5ef55e42ce42221f58dc49943e92ccad1fa66a"><code>7d5ef55</code></a> chore: prepare 2.15.1 release</li> <li><a href="https://github.com/jpadilla/pyjwt/commit/7bf32526738fe837387bdedd4849a4a525c33a79"><code>7bf3252</code></a> Accept canonical Base64URL padding in JWT segments (<a href="https://redirect.github.com/jpadilla/pyjwt/issues/1216">#1216</a>)</li> <li>See full diff in <a href="https://github.com/jpadilla/pyjwt/compare/2.15.0...2.15.1">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/a2aproject/a2a-python/network/alerts). </details> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mykytanetipa <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e11cb3e - Browse repository at this point
Copy the full SHA e11cb3eView commit details -
fix(client): ignore the patch version when preferring a 1.0 interface (…
…#1304) # Description `ClientFactory._find_best_interface` prefers a 1.0 interface with an exact string comparison (`protocol_version == '1.0'`). When an agent card lists a legacy interface and a 1.0 interface written with a patch version, e.g. ```python supported_interfaces=[ AgentInterface(url='http://agent/v03', protocol_binding='JSONRPC', protocol_version='0.3.0'), AgentInterface(url='http://agent/v1', protocol_binding='JSONRPC', protocol_version='1.0.0'), ] ``` the `1.0.0` entry is neither equal to `'1.0'` nor greater than `1.0`, so the loop falls through to the first `>= 0.3` candidate and the client is built with `CompatJsonRpcTransport` against `/v03`, i.e. it speaks v0.3 to an agent that supports 1.0. (`'1.0'` and `'1.1'` are handled correctly.) The specification's versioning section says patch versions "MUST not be considered when clients and servers negotiate protocol versions". Patch versions do show up in practice; several tests in this repo build cards with `protocol_version='1.0.0'`. - Compare the `Major.Minor` release (`packaging.version.Version(...).release[:2]`) instead of the raw string, via a small `_major_minor` helper (kept out of the loop for ruff's PERF203). - Regression test: with `0.3.0` listed first, both `1.0` and `1.0.0` must select the 1.0 interface and `JsonRpcTransport`. The `1.0.0` case fails on main with `CompatJsonRpcTransport`. Checks: `scripts/lint.sh` clean, `uv run pytest` 2183 passed (plus `tests/integration/cross_version` 5 passed), coverage 93%. - [x] Follow the [`CONTRIBUTING` Guide](https://github.com/a2aproject/a2a-python/blob/main/CONTRIBUTING.md). - [x] Make your Pull Request title in the <https://www.conventionalcommits.org/> specification. - [x] Ensure the tests and linter pass - [x] Appropriate docs were updated (if necessary) --------- Co-authored-by: mykytanetipa <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for cbb2d84 - Browse repository at this point
Copy the full SHA cbb2d84View commit details
Commits on Oct 7, 2026
-
fix(server): warn when an AgentCard is missing required fields (#1279)
# Description `AgentCard` marks eight fields `REQUIRED`, but nothing in the SDK checks them, so an empty `AgentCard()` is served as `{}` with HTTP 200. Following the "suggested first step" in #1267, this logs a warning instead of raising, so existing non-compliant cards keep working while the problem becomes visible. **Changes** - `a2a.utils.proto_utils.warn_on_missing_required_fields(msg, source) -> bool`: runs the existing required-field check (`_validate_proto_required_fields_internal`) and logs one `WARNING` listing the fields that are missing or empty, including nested paths such as `skills[0].tags`. It never raises and returns whether the message was complete. Objects that are not Protobuf messages are skipped: an existing test in `test_default_request_handler.py` passes a non-card object as `agent_card`, and user code does the same with test doubles, so a warning helper must not turn that into an `AttributeError`. - Called where a card enters or leaves the SDK: - `create_agent_card_routes(agent_card=...)` - `DefaultRequestHandler.__init__` and `DefaultRequestHandlerV2.__init__` for `agent_card` and, when given, `extended_agent_card` - `agent_card_to_dict`, which serializes every served card (including cards from `card_modifier` / `extended_card_modifier`), so this one logs per request; it can be silenced through the `a2a.utils.proto_utils` logger - `signing._canonicalize_agent_card`, used when signing and verifying a card For an empty card the log reads: ``` agent_card passed to create_agent_card_routes: AgentCard is not spec-compliant - REQUIRED fields missing or empty: name, description, supported_interfaces, version, capabilities, default_input_modes, default_output_modes, skills. This is allowed and does not raise, but it may not verify or interoperate across SDKs and could be rejected in a future major release. See https://a2a-protocol.org/latest/specification/#57-field-presence-and-optionality ``` Enforcement (raising) is left for a major version, as the issue suggests. **Tests** (`uv run pytest`) - `tests/utils/test_proto_utils.py`: complete message returns `True` with no log; empty message returns `False` and logs the exact message instead of raising; an empty repeated field is reported; nested paths are reported. - `tests/server/routes/test_agent_card_routes.py`: an incomplete card logs a warning and is still served with 200; a complete card logs nothing. - `tests/server/request_handlers/test_default_request_handler.py` and `..._v2.py`: incomplete `agent_card` and `extended_agent_card` each log one warning; complete cards log nothing. - `tests/server/request_handlers/test_response_helpers.py`: `agent_card_to_dict` warns for an incomplete card and stays silent for a complete one. - `tests/utils/test_signing.py`: `_canonicalize_agent_card` warns for an incomplete card. - The warning-asserting tests fail on `main` and pass with this change. - `bash scripts/lint.sh` (ruff check, ruff format, ty) passes. - `uv run pytest --ignore=tests/integration`: 1829 passed, 169 skipped, 3 xfailed. - On Windows, some `tests/integration` tests that spawn server subprocesses fail identically on `main`, so I relied on CI for those. --- - [x] Follow the [`CONTRIBUTING` Guide](https://github.com/a2aproject/a2a-python/blob/main/CONTRIBUTING.md). - [x] Make your Pull Request title in the <https://www.conventionalcommits.org/> specification. - [x] Ensure the tests and linter pass (Run `bash scripts/format.sh` from the repository root to format) - [x] Appropriate docs were updated (if necessary) Fixes #1267 🦕Configuration menu - View commit details
-
Copy full SHA for 4f4101c - Browse repository at this point
Copy the full SHA 4f4101cView commit details -
test(signing): add cross-SDK signature vectors (#1286)
Adds tests that pin what a change to `_canonicalize_agent_card` (#1278) has to keep: a card signed by another SDK still verifies here. Test only; no library code changes. - `tests/utils/signing_interop_vectors.json`: the five `s0-control` vectors of the `a2a-card-sign-v01` corpus (a2aproject/a2a-tck#246), each lifted verbatim, the same way `jcs_vectors.json` was lifted from a2aproject/a2a-tck#228. One card with every REQUIRED field and no field at its default value, signed by this SDK, @a2a-js/sdk 1.3.0, a2a-go (main 534a60fc) and a reference signer, plus the reference signature on the card edited after signing. These expectations hold however a2aproject/A2A#2122 is settled. - `tests/utils/test_signing_interop.py`: - each of the four signed cards verifies; - each canonicalizes to the shared bytes; - the edited card raises `InvalidSignaturesError`; - the frozen JS-signed production card from a2aproject/a2a-go#445 verifies and keeps 6410 bytes / `c5d5384a…`, the anchors @kuangmi-bit set out in #1278. Its file hashes are asserted too, so the fixture cannot drift. One caveat on that last test: the frozen card carries `securityRequirements: [{}]`, a nested empty value whose canonical form is part of #2122. So it pins today's bytes, the ones this SDK and @a2a-js/sdk agree on, as agreed in #1278, and it needs updating if #2122 settles the other way. The docstring says so. The reading-dependent group (`s1-default-valued`: `description: ""`, `skills: []`, `tags: []`, `extensions: []`) is deliberately not lifted. Its expectations depend on #2122, and adding them now would lock in one answer before the spec does. All 11 tests pass on main (fad0482). `ruff check`, `ruff format --check` and `ty check` are clean. The production card is ours (HORIZON SHIELD publishes it). If you would rather not carry it in the repo, `test_frozen_js_signed_production_card` and its two files drop out cleanly. cc @aeoess @kuangmi-bit --------- Signed-off-by: Horizon <[email protected]> Co-authored-by: Horizon <[email protected]> Co-authored-by: Mateusz Iwaniuk <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 494a8ec - Browse repository at this point
Copy the full SHA 494a8ecView commit details
Commits on Oct 12, 2026
-
test: install HTTP dependencies for the legacy cross-version server (#…
…1320) # Description The cross-version fixture starts the 0.3.24 FastAPI/JSON-RPC server in an isolated `uv --no-project` environment, but requests only `a2a-sdk[grpc]`. That environment lacks `sse-starlette`, so server startup raises `ImportError` and all four cross-version combinations fail during setup. Request `a2a-sdk[grpc,http-server]==0.3.24` for that server. This changes one test dependency declaration; the client environments and SDK runtime dependencies stay as they are. Validation on main `e11cb3e55dd536bee99fe185723db3c8ff6f8a13`, Python 3.12.11: - Before: four cross-version setup errors; the legacy server reports the missing HTTP-server packages. - After: `./scripts/lint.sh` exits 0; `uv run pytest --timeout=45` reports **2243 passed, 183 skipped, 3 xfailed, 1 xpassed**. All four cross-version combinations pass. - `git diff --check` passes. Skipped coverage includes external PostgreSQL/MySQL services; they were not configured locally. The existing expected-failure markers reference #869. - [x] Followed the contribution guide and conventional-commit title format. - [x] Tests and linter pass. - [x] Documentation changes are not needed for this test-environment dependency. AI-assisted investigation and validation with Codex for Mission. Co-authored-by: gomission <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 799fcae - Browse repository at this point
Copy the full SHA 799fcaeView commit details -
fix(server): isolate push notification failures from the task lifecyc…
…le (#1329) ## Description A failure in the push-notification infrastructure (a transient error while reading `PushNotificationConfigStore`, or a raising `push_url_validator`) propagated into the event-consumer's generic failure path and rewrote an otherwise successful task as `TASK_STATE_FAILED`, failing `message/send` instead of returning the task result. Root-cause analysis and a runtime reproduction are in #1313. This adds non-breaking guards so that push delivery stays best-effort, in **both** handlers: - `BasePushNotificationSender.send_notification`: the `get_info_for_dispatch` lookup now runs inside an error boundary, and a raising `push_url_validator` is treated as a rejected URL (fail closed) — both log via `logger.exception` and degrade to "notification not sent". - `DefaultRequestHandlerV2` (`EventConsumer._update_task_state`): the `send_notification` call is wrapped in `try/except` so a sender failure is logged and never disturbs the task state or the event stream. - `LegacyRequestHandler._send_push_notification_if_needed`: the same unguarded call existed in the legacy handler (both the blocking and streaming paths) — guarded identically. This matches the existing design intent of `_dispatch_notification`, which already contains all delivery failures and returns `bool`. Notes for reviewers: - **Cancellation is unaffected**: all guards use `except Exception`, and `asyncio.CancelledError` derives from `BaseException`, so cancellation still propagates. - The best-effort contract is now documented on the `PushNotificationSender` ABC and `BasePushNotificationSender` (custom implementations may raise; the framework logs and continues). - [x] Follow the [`CONTRIBUTING` Guide](https://github.com/a2aproject/a2a-python/blob/main/CONTRIBUTING.md). - [x] Pull Request title follows the [conventional commits](https://www.conventionalcommits.org/) specification (`fix:` prefix for a SemVer patch). - [x] Tests and linter pass. - [x] Appropriate docs were updated (interface/base docstrings now state the best-effort contract). Fixes #1313 🦕 ## Testing - `tests/server/tasks/test_push_notification_sender.py`: - config-store read failure is swallowed (no raise, no POST, logged); - a raising `push_url_validator` rejects the URL without propagating. - `tests/server/request_handlers/test_default_request_handler_v2.py`: - end-to-end: with a failing push config store, `message/send` still returns the `Task` with `TASK_STATE_COMPLETED` and the persisted state is untouched (previously rewritten to `FAILED`); - end-to-end: a raising custom `PushNotificationSender` (public interface) is equally harmless — covers the consumer-level guard. - `tests/server/request_handlers/test_default_request_handler.py`: - a raising sender does not propagate out of `_send_push_notification_if_needed`. - Lint/type: ruff check --fix, ruff format, ty check all clean (the 5 `unused-ignore-comment` warnings pre-exist on `main`). - Full suite: 2274 passed, 0 failed; coverage 93% (gate 88%), all touched files improved. --------- Signed-off-by: andy <[email protected]> Co-authored-by: mykytanetipa <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0ee47d7 - Browse repository at this point
Copy the full SHA 0ee47d7View commit details
Commits on Oct 14, 2026
-
fix(server): release the ActiveTask after a direct Message response (#…
…1297) ## Description A direct `Message` is a complete response for interactions that do not need task tracking (spec §3.1.1: the agent "MAY return a direct `Message` response for simple interactions"; §3.1.2: a message-only stream provides "No task tracking or updates"). No follow-up can continue such a request. `DefaultRequestHandlerV2` still kept the request's `ActiveTask` alive after a `Message` response: - the producer stays parked on `self._request_queue.get()`; - the consumer and both `EventQueueSource._dispatch_loop` tasks wait with it; - the entry stays in the `ActiveTaskRegistry`. Every message-only request therefore leaves **four pending asyncio tasks** behind until the process exits. In a long-running server, the pending task count grows linearly with traffic. ### Fix After the consumer forwards the `Message` to subscribers, it finishes the `ActiveTask` the same way it already does for a terminal task state: it sets `_is_finished` and shuts down the request queue (`_handle_terminal_state`). The producer then leaves its loop and closes the event queues, the consumer drains and exits, and `_maybe_cleanup` removes the registry entry. The `Message` is enqueued to subscribers **before** the shutdown, so `on_message_send` and `on_message_send_stream` still receive it. Out of scope: input-required tasks stay parked for a follow-up, as covered by `test_cancel_of_input_required_task_cannot_be_undone`. This PR does not change that. ### Tests Two new tests in `tests/server/request_handlers/test_default_request_handler_v2.py` drive the real handler with an executor that answers with a single `Message`: - `test_on_message_send_message_response_releases_active_task`: 3 × `on_message_send`, then no pending asyncio tasks and an empty registry; - `test_on_message_send_stream_message_response_releases_active_task`: a message-only stream yields exactly one `Message`, then the same assertions. Both fail on `main` (leftover `ActiveTask._run_producer`, `ActiveTask._run_consumer` and `EventQueueSource._dispatch_loop`) and pass with the fix. Standalone repro, 50 requests each, counting pending asyncio tasks afterwards: ``` main (ddce6b8) this PR completed 0 0 message 200 0 input-required 200 200 (unchanged, by design) ``` ### Checks - `./scripts/lint.sh`: passed. The 3 `ty` warnings are pre-existing, in `client_factory.py` and `client/transports/__init__.py`. - `uv run pytest`: 2173 passed, 181 skipped, 3 xfailed, 1 xpassed. - `uv run pytest --cov=src`: total 93 %, `active_task.py` 95 %; the new lines are covered. Part of #1296 (the direct-Message case; the input-required case stays open)
Configuration menu - View commit details
-
Copy full SHA for 49ebce6 - Browse repository at this point
Copy the full SHA 49ebce6View commit details -
fix(compat): block on a v0.3 gRPC and REST send without configuration (…
…#1334) ## Problem `FromProto.message_send_params` built a configuration even when the proto `configuration` field was unset, so proto3's default `blocking=False` came through. v0.3 gRPC and REST sends without a configuration returned right away, while JSON-RPC blocked. ## Fix Map an unset `configuration` to `None`, so all three transports block by default. REST goes through the same function. ## Tests `test_message_send_params_without_configuration` fails on main. The three `test_grpc_handler.py` cases that expected `return_immediately=True` now expect no configuration. 2270 passed. Fixes #1321 Co-authored-by: Mateusz Iwaniuk <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8160310 - Browse repository at this point
Copy the full SHA 8160310View commit details -
fix(server): mark internal lifecycle events done so a cancelled strea…
…m frees its producer (#1336) Fixes #1322. ## Problem When a streamed task is cancelled, its background producer never finishes and the `producer:<task_id>` entry is never pruned from the registry. In `ActiveTask.subscribe`, the two internal lifecycle events `_RequestStarted` and `_RequestCompleted` are dequeued from the per-subscriber tapped queue and then skipped with `continue` (or `return`) **without** calling `tapped_queue.task_done()`. Because those items are never marked done, the producer's teardown `await self._event_queue_subscribers.close(immediate=False)` waits forever on a tap that still has unfinished items, so `_run_producer` never completes. The maintainer confirmed the root cause and approved this fix in #1322. ## Fix Call `tapped_queue.task_done()` on the `_RequestStarted` / `_RequestCompleted` branches before they are skipped, so the tapped queue's unfinished count returns to zero and `close(immediate=False)` can complete. One-line change in `src/a2a/server/agent_execution/active_task.py`. ## Regression test `tests/server/agent_execution/test_active_task.py::TestActiveTask::test_active_task_cancel_while_subscribed_frees_producer`, built on the module's existing fixtures. It drives a subscriber past `_RequestStarted`, cancels the producer (the streamed-cancel path), and asserts the producer task completes rather than wedging. ## Verification - Test **passes** with the fix and **fails with `TimeoutError`** when the source change is temporarily reverted (confirming it catches the bug rather than being green by construction). - Full `active_task` module: 33 passed. - Broader server sweep (`agent_execution` + cluster cancel/subscribe + default request handler): 172 passed. - `ruff check` and `ruff format --check`: clean. --------- Signed-off-by: Carsten Piepel <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a4c4fc9 - Browse repository at this point
Copy the full SHA a4c4fc9View commit details
Commits on Oct 16, 2026
-
fix(compat): treat a v0.3 history_length of 0 as unlimited in JSON-RP…
…C and REST (#1312) ## Problem `to_core_send_message_configuration` and `to_core_get_task_request` passed a v0.3 `history_length` of 0 through as a limit, so v0.3 JSON-RPC and REST GetTask returned tasks with empty history. In v0.3, 0 means unlimited. ## Fix Skip `history_length` when it is 0, as the gRPC path already does since #1306. Follow-up to #1306 from the review there. ## Tests `test_send_message_configuration_conversion_history_length_zero` and `test_get_task_request_conversion_history_length_zero` in `test_conversions.py`. Fixes #1311 --------- Co-authored-by: Mateusz Iwaniuk <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e86695c - Browse repository at this point
Copy the full SHA e86695cView commit details
Commits on Oct 17, 2026
-
fix(server): reject push URLs in shared address space (#1326)
## Summary `validate_push_notification_url` rejects a resolved address when `ipaddress` reports it as private, loopback, link-local, reserved, multicast, or unspecified. 100.64.0.0/10 (RFC 6598 shared address space) is not a public destination: `is_global` is false. `is_private` is also false for that range on Python 3.10 through 3.14, so a push URL that resolves to 100.64.0.1 was accepted and the server POSTed the task event there. The same hole exists for the IPv4-mapped form `::ffff:100.64.0.1`. The check now treats that range as blocked, and judges an IPv4-mapped address as the IPv4 address it carries. 100.63.255.255, just below the range, stays allowed. ## Test plan - [x] Before the range check, `test_shared_address_space_blocked` and `test_ipv4_mapped_shared_address_blocked` fail because `post` is called. - [x] After the check, `TestPushUrlValidation` passes (11 tests), including 100.63.255.255 still allowed. --------- Co-authored-by: mykytanetipa <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 01da00b - Browse repository at this point
Copy the full SHA 01da00bView commit details
Commits on Oct 19, 2026
-
chore(main): release 1.2.3 (#1315)
🤖 I have created a release *beep* *boop* --- ## [1.2.3](v1.2.2...v1.2.3) (2026-10-17) ### Bug Fixes * **client:** ignore the patch version when preferring a 1.0 interface ([#1304](#1304)) ([cbb2d84](cbb2d84)) * **client:** normalize malformed agent card parsing errors ([#1307](#1307)) ([486f0f6](486f0f6)) * **compat:** block on a v0.3 gRPC and REST send without configuration ([#1334](#1334)) ([8160310](8160310)), closes [#1321](#1321) * **compat:** treat a v0.3 history_length of 0 as unlimited in JSON-RPC and REST ([#1312](#1312)) ([e86695c](e86695c)) * **jcs:** count open containers for the nesting bound, so an empty container leaf is refused ([#1294](#1294)) ([5653daf](5653daf)) * **server:** isolate push notification failures from the task lifecycle ([#1329](#1329)) ([0ee47d7](0ee47d7)) * **server:** mark internal lifecycle events done so a cancelled stream frees its producer ([#1336](#1336)) ([a4c4fc9](a4c4fc9)) * **server:** reject push URLs in shared address space ([#1326](#1326)) ([01da00b](01da00b)) * **server:** release the ActiveTask after a direct Message response ([#1297](#1297)) ([49ebce6](49ebce6)) * **server:** run follow-up messages in the sender's contextvars ([#1317](#1317)) ([a016002](a016002)) * **server:** warn when an AgentCard is missing required fields ([#1279](#1279)) ([4f4101c](4f4101c)) * **telemetry:** let trace_function alone decide a span's status ([#1309](#1309)) ([59dcbfb](59dcbfb)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Configuration menu - View commit details
-
Copy full SHA for 44b2f76 - Browse repository at this point
Copy the full SHA 44b2f76View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v1.2.2...v1.2.3