Skip to content

fix: return 404/-32001 for missing push notification configs - #630

Merged
JakubWorek merged 4 commits into
a2aproject:mainfrom
ez-lbz:fix/push-config-notfound-404
Aug 26, 2026
Merged

JakubWorek merged 4 commits into
a2aproject:mainfrom
ez-lbz:fix/push-config-notfound-404

Conversation

@ez-lbz

@ez-lbz ez-lbz commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

What changed

1. Map missing push-notification config to 404 / -32001

Problem: getTaskPushNotificationConfig threw a bare A2AError when no config existed for the task (or the requested config id was unknown). A bare A2AError has no transport mapping, so REST returned 500 (INTERNAL_ERROR / -32603 on JSON-RPC) instead of the semantic "not found" response. Python returns 404 for this case; Go had the same 500 bug.

Fix (src/server/request_handler/default_request_handler.ts):

  • Both not-found branches in getTaskPushNotificationConfig now throw TaskNotFoundError, which maps to HTTP 404 on REST and -32001 on JSON-RPC (the TaskNotFound-class code the plan targets), matching Python's behavior.

Testing

  • npm test — 68 test files, 1508 tests passed.
  • npx tsc --noEmit — no errors in src/; npx tsc --noEmit -p tsconfig.test.json passes.
  • New regression tests: getTaskPushNotificationConfig with no stored configs, and with an unknown config id, both reject with TaskNotFoundError. The existing REST test (GET /tasks/:taskId/pushNotificationConfigs/:configId → 404 with TASK_NOT_FOUND detail) now exercises the real handler path.

Behavior change: missing push-notification configs now return 404 (REST) / -32001 (JSON-RPC) instead of 500 / -32603.

@ez-lbz
ez-lbz requested a review from a team as a code owner August 10, 2026 16:26
@github-actions

github-actions Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

🧪 Code Coverage

⬇️ Download Full Report

Base PR Delta
src/server/request_handler/default_request_handler.ts 87.99% 88.68% 🟢 +0.69%
Total 91.23% 91.29% 🟢 +0.06%

Generated by coverage-comment.yml

@JakubWorek

Copy link
Copy Markdown
Member

Hi @ez-lbz, looks like this PR contains commit not related to the description, taken from #625. Could you update the branch to contain only relevant changes?

@ez-lbz
ez-lbz force-pushed the fix/push-config-notfound-404 branch from f33ace8 to 8ae44fe Compare August 20, 2026 14:17
@ez-lbz

ez-lbz commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Hi @JakubWorek, thanks for the heads-up — the branch was based on a chain that included the #625 commits. I've rebased it onto the current main and removed the unrelated commits; it now contains only the missing-push-config 404 change (plus the prettier/tracking-id cleanup). All 1492 tests pass locally.

@JakubWorek JakubWorek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@JakubWorek
JakubWorek merged commit 34f06e3 into a2aproject:main Aug 26, 2026
15 checks passed
bartek-gralewicz added a commit that referenced this pull request Sep 18, 2026
🤖 I have created a release *beep* *boop*
---


## [1.2.0](v1.1.0...v1.2.0)
(2026-09-18)


### Features

* **server:** Introduce SettleByTaskId method
([#692](#692))
([e856bda](e856bda))


### Bug Fixes

* accept GetExtendedAgentCard JSON-RPC calls with omitted params
([#687](#687))
([047d970](047d970))
* avoid mutating caller message configuration
([#725](#725))
([e3a6428](e3a6428))
* **client:** cache the extended Agent Card only after signature
verification ([#711](#711))
([55b601c](55b601c))
* guard terminal state transitions and make cancelTask atomic
([#636](#636))
([7b87c94](7b87c94))
* preserve call context for JSON-RPC tenant requests
([#708](#708))
([ae20aca](ae20aca))
* preserve HeadersInit in authenticating fetch
([#721](#721))
([f8c33fa](f8c33fa))
* preserve historyLength=0 and reject invalid REST listTasks pageSize
([#685](#685))
([32c1865](32c1865))
* reject empty task IDs with RequestMalformedError in getTask/cancelTask
([#629](#629))
([71aae97](71aae97))
* reject invalid ListTasks status filters with RequestMalformedError
([#631](#631))
([a881fae](a881fae))
* reject missing required extensions before mutating task history
([#690](#690))
([3b4ef3f](3b4ef3f))
* reject whitespace-only taskId on sendMessage
([#689](#689))
([85227a0](85227a0))
* return 404/-32001 for missing push notification configs
([#630](#630))
([34f06e3](34f06e3))
* scope ExecutionEventBusManager by tenant and owner to match TaskStore
([#707](#707))
([69d8899](69d8899))
* stamp the resolved taskId onto sendMessage push configs
([#688](#688))
([cfb19a8](cfb19a8))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: Bartek Gralewicz <[email protected]>
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.

2 participants