Skip to content

fix: validate JSON-RPC response version - #698

Merged
bartek-gralewicz merged 4 commits into
a2aproject:mainfrom
russlan23:fix/validate-jsonrpc-response-version
Sep 21, 2026
Merged

bartek-gralewicz merged 4 commits into
a2aproject:mainfrom
russlan23:fix/validate-jsonrpc-response-version

Conversation

@russlan23

Copy link
Copy Markdown
Contributor

Description

Fixes #696.

Summary

  • reject JSON-RPC response envelopes unless jsonrpc is exactly "2.0";
  • apply the same validation to ordinary JSON responses and each streaming SSE event;
  • cover missing and invalid protocol versions on both response paths.

Testing

  • npm run lint:ci
  • npm test -- --run test/client/transports/json_rpc_transport.spec.ts — 17 passed
  • npm test — 68 files and 1,529 tests passed

Checklist

  • Follow the CONTRIBUTING Guide.
  • Use a Conventional Commits pull request title.
  • Ensure the tests and linter pass.
  • Update the appropriate documentation if necessary.

@russlan23
russlan23 requested a review from a team as a code owner September 3, 2026 17:32
@github-actions

github-actions Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

🧪 Code Coverage

⬇️ Download Full Report

Base PR Delta
src/client/transports/json_rpc_transport.ts 72.2% 77.05% 🟢 +4.85%
src/server/store.ts 66.3% 68.47% 🟢 +2.17%
Total 85.33% 85.46% 🟢 +0.13%

Generated by coverage-comment.yml

@bartek-gralewicz bartek-gralewicz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contributing!

@bartek-gralewicz
bartek-gralewicz merged commit e0cdc91 into a2aproject:main Sep 21, 2026
16 checks passed
bartek-gralewicz pushed a commit that referenced this pull request Sep 24, 2026
🤖 I have created a release *beep* *boop*
---


## [1.2.1](v1.2.0...v1.2.1)
(2026-09-24)


### Bug Fixes

* issue that status or artifact events do not propagate the metatadata
to the task ([#748](#748))
([72588af](72588af))
* **jsonrpc:** return JSON-RPC errors as HTTP 200 and dispatch on
A2A-Version ([#747](#747))
([733259d](733259d))
* **rest:** ensure taskId is correctly set from path parameters when
creating push notification configs
([#740](#740))
([4a42ec1](4a42ec1))
* **server:** add optional media type validation against agent
defaultInputModes
([#745](#745))
([27659a2](27659a2))
* validate JSON-RPC response version
([#698](#698))
([e0cdc91](e0cdc91))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: JSON-RPC client accepts responses with missing or invalid jsonrpc version

2 participants