fix(a2a): convert A2aOperationNotFoundError to JSON-RPC error response in dispatch() #3203

Open
freemo wants to merge 4 commits from fix/a2a-dispatch-not-found-error-response into master

4 Commits

Author SHA1 Message Date
controller-ci-rerun f3ad565803 chore: re-trigger CI [controller]
CI / helm (pull_request) Successful in 41s
CI / push-validation (pull_request) Successful in 38s
CI / build (pull_request) Successful in 42s
CI / lint (pull_request) Successful in 52s
CI / typecheck (pull_request) Successful in 1m14s
CI / quality (pull_request) Successful in 1m31s
CI / security (pull_request) Successful in 1m37s
CI / unit_tests (pull_request) Successful in 4m50s
CI / integration_tests (pull_request) Failing after 20m36s
CI / docker (pull_request) Failing after 15m47s
CI / coverage (pull_request) Failing after 15m48s
CI / status-check (pull_request) Has been cancelled
2026-06-18 10:57:43 -04:00
HAL9000 5664988995 fix(tests): update BDD scenarios to assert JSON-RPC error response for unknown operations
CI / push-validation (pull_request) Successful in 24s
CI / helm (pull_request) Successful in 30s
CI / unit_tests (pull_request) Failing after 11m25s
CI / quality (pull_request) Failing after 11m28s
CI / security (pull_request) Failing after 11m30s
CI / typecheck (pull_request) Failing after 11m31s
CI / lint (pull_request) Failing after 11m31s
CI / build (pull_request) Failing after 11m57s
CI / integration_tests (pull_request) Failing after 11m57s
CI / status-check (pull_request) Has been cancelled
CI / coverage (pull_request) Has been cancelled
CI / docker (pull_request) Has been cancelled
`A2aLocalFacade.dispatch()` now returns an A2aResponse with error code
-32601 instead of raising A2aOperationNotFoundError. Update all affected
BDD step definitions and feature scenarios to assert the new behaviour:

- `a2a_facade_steps.py`: step_dispatch_unknown stores the response;
  step_op_not_found_raised checks response.error.code == -32601
- `m6_facade_steps.py`: same pattern for m6 smoke steps; remove unused
  A2aOperationNotFoundError import
- `consolidated_misc.feature`: remove the stale "error operation attribute"
  step that tested the old exception attribute
- `a2a_jsonrpc_wire_format_steps.py`: import A2A_CODE_MAP and use integer
  codes in step_create_error_response, step_create_response_both_result_and_error,
  and step_jsonrpc_error_response_dict (A2aErrorDetail.code is now int)
- `asgi_app.py`: remove the now-unreachable except A2aOperationNotFoundError
  block; instead check response.error.code == -32601 and return HTTP 404
2026-05-30 14:57:41 -04:00
HAL9000 03cafe4ede fix(a2a): use integer code -32601 and coerce Gherkin string in assertion
A2aErrorDetail.code is typed as int (per JSON-RPC 2.0 §5.1 and the
model docstring). Use the integer literal -32601 in facade.py and
coerce the Gherkin-captured string to int in the step assertion so
int(-32601) == int(-32601) instead of int(-32601) == str("-32601").

ISSUES CLOSED: #2859
2026-05-30 14:57:41 -04:00
freemo d0d37c4af9 fix(a2a): convert A2aOperationNotFoundError to JSON-RPC error response in dispatch()
A2aLocalFacade.dispatch() was re-raising A2aOperationNotFoundError instead
of converting it to a JSON-RPC 2.0 error response. Per JSON-RPC 2.0 spec,
the server MUST return an error response object when a method is not found
— it must never raise an exception to the caller.

Changes:
- facade.py: catch A2aOperationNotFoundError and return A2aResponse with
  error code -32601 (JSON-RPC 2.0 'Method not found') and log a warning
- a2a_jsonrpc_wire_format_steps.py: remove exception-catching workaround
  from step_wire_dispatch() that was masking the bug; add step definition
  for asserting error code value
- a2a_jsonrpc_wire_format.feature: add scenario asserting unknown method
  dispatch returns JSON-RPC 2.0 error code -32601

ISSUES CLOSED: #2859
2026-05-30 14:57:41 -04:00