UAT: A2aRequest and A2aResponse Behave step definitions use stale pre-JSON-RPC-2.0 field names — tests will fail at runtime #2132

Open
opened 2026-04-03 04:19:55 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/a2a-step-definitions-jsonrpc2-field-names
  • Commit Message: fix(a2a): update Behave step definitions to use JSON-RPC 2.0 field names
  • Milestone: v3.7.0
  • Parent Epic: #933

Background and Context

The A2A protocol was migrated to JSON-RPC 2.0 wire format, which changed the field names on A2aRequest and A2aResponse. However, the Behave step definitions in features/steps/a2a_facade_steps.py were not updated to reflect the new model. They still reference the old pre-migration field names, meaning any scenario that exercises these steps will raise an AttributeError at runtime.

Per the specification, the A2A protocol uses JSON-RPC 2.0 framing: A2aRequest has fields jsonrpc, id, method, and params; A2aResponse has fields jsonrpc, id, and either result or error.

Current Behavior

Four step definitions in features/steps/a2a_facade_steps.py reference fields that no longer exist on the current Pydantic models:

  1. step_request_has_id (~line 258): accesses context.request.request_id — field no longer exists; the correct field is id.
  2. step_request_version (~line 262): accesses context.request.a2a_version — field no longer exists; the correct field is jsonrpc (value "2.0").
  3. step_create_response (~line 272): constructs A2aResponse(request_id=rid, status=status) — neither request_id nor status are valid constructor parameters; the constructor now takes id and either result or error.
  4. step_create_response_invalid (~line 280): constructs A2aResponse(request_id="REQ", status=status) — same issue as above.

Affected scenarios in features/consolidated_misc.feature (~lines 255–280):

  • "A2aRequest with valid operation succeeds" → checks request_id and a2a_version
  • "A2aResponse with valid status ok succeeds" → uses old constructor
  • "A2aResponse with invalid status fails validation" → uses old constructor

Running these scenarios produces AttributeError at runtime.

Expected Behavior

Step definitions must use the current JSON-RPC 2.0 field names:

  • context.request.id (not request_id)
  • context.request.jsonrpc with value "2.0" (not a2a_version)
  • A2aResponse(id=rid, result=...) or A2aResponse(id=rid, error=...) (not request_id= or status=)

All three affected scenarios must pass without AttributeError.

Acceptance Criteria

  • step_request_has_id reads context.request.id and asserts it matches the expected value.
  • step_request_version reads context.request.jsonrpc and asserts it equals "2.0".
  • step_create_response constructs A2aResponse using id and result (or error) parameters.
  • step_create_response_invalid constructs A2aResponse using id and error parameters for the invalid-status scenario.
  • All three scenarios in features/consolidated_misc.feature pass without error.
  • No regressions in any other A2A-related scenarios.

Supporting Information

  • Code locations:
    • features/steps/a2a_facade_steps.pystep_request_has_id, step_request_version, step_create_response, step_create_response_invalid
    • features/consolidated_misc.feature — scenarios around lines 255–280
  • Severity: High — unit tests for core A2A model validation are broken and will fail at runtime.
  • Related Epic: #933 — A2A Protocol Compliance — JSON-RPC 2.0 Framing, Standard Operations, and Extension Methods

Subtasks

  • Audit features/steps/a2a_facade_steps.py for all stale pre-JSON-RPC-2.0 field references
  • Update step_request_has_id to access context.request.id instead of context.request.request_id
  • Update step_request_version to access context.request.jsonrpc and assert value "2.0" instead of context.request.a2a_version
  • Update step_create_response to construct A2aResponse(id=rid, result=...) instead of A2aResponse(request_id=rid, status=status)
  • Update step_create_response_invalid to construct A2aResponse(id=..., error=...) instead of A2aResponse(request_id=..., status=...)
  • Verify all three affected scenarios in features/consolidated_misc.feature pass without AttributeError
  • Verify no regressions in other A2A Behave scenarios
  • Run nox (all default sessions) and fix any errors
  • Verify coverage >= 97% via nox -s coverage_report

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly (fix(a2a): update Behave step definitions to use JSON-RPC 2.0 field names), followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly (fix/a2a-step-definitions-jsonrpc2-field-names).
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass.
  • Coverage >= 97%.

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/a2a-step-definitions-jsonrpc2-field-names` - **Commit Message**: `fix(a2a): update Behave step definitions to use JSON-RPC 2.0 field names` - **Milestone**: v3.7.0 - **Parent Epic**: #933 ## Background and Context The A2A protocol was migrated to JSON-RPC 2.0 wire format, which changed the field names on `A2aRequest` and `A2aResponse`. However, the Behave step definitions in `features/steps/a2a_facade_steps.py` were not updated to reflect the new model. They still reference the old pre-migration field names, meaning any scenario that exercises these steps will raise an `AttributeError` at runtime. Per the specification, the A2A protocol uses JSON-RPC 2.0 framing: `A2aRequest` has fields `jsonrpc`, `id`, `method`, and `params`; `A2aResponse` has fields `jsonrpc`, `id`, and either `result` or `error`. ## Current Behavior Four step definitions in `features/steps/a2a_facade_steps.py` reference fields that no longer exist on the current Pydantic models: 1. **`step_request_has_id` (~line 258)**: accesses `context.request.request_id` — field no longer exists; the correct field is `id`. 2. **`step_request_version` (~line 262)**: accesses `context.request.a2a_version` — field no longer exists; the correct field is `jsonrpc` (value `"2.0"`). 3. **`step_create_response` (~line 272)**: constructs `A2aResponse(request_id=rid, status=status)` — neither `request_id` nor `status` are valid constructor parameters; the constructor now takes `id` and either `result` or `error`. 4. **`step_create_response_invalid` (~line 280)**: constructs `A2aResponse(request_id="REQ", status=status)` — same issue as above. Affected scenarios in `features/consolidated_misc.feature` (~lines 255–280): - "A2aRequest with valid operation succeeds" → checks `request_id` and `a2a_version` - "A2aResponse with valid status ok succeeds" → uses old constructor - "A2aResponse with invalid status fails validation" → uses old constructor Running these scenarios produces `AttributeError` at runtime. ## Expected Behavior Step definitions must use the current JSON-RPC 2.0 field names: - `context.request.id` (not `request_id`) - `context.request.jsonrpc` with value `"2.0"` (not `a2a_version`) - `A2aResponse(id=rid, result=...)` or `A2aResponse(id=rid, error=...)` (not `request_id=` or `status=`) All three affected scenarios must pass without `AttributeError`. ## Acceptance Criteria - `step_request_has_id` reads `context.request.id` and asserts it matches the expected value. - `step_request_version` reads `context.request.jsonrpc` and asserts it equals `"2.0"`. - `step_create_response` constructs `A2aResponse` using `id` and `result` (or `error`) parameters. - `step_create_response_invalid` constructs `A2aResponse` using `id` and `error` parameters for the invalid-status scenario. - All three scenarios in `features/consolidated_misc.feature` pass without error. - No regressions in any other A2A-related scenarios. ## Supporting Information - **Code locations**: - `features/steps/a2a_facade_steps.py` — `step_request_has_id`, `step_request_version`, `step_create_response`, `step_create_response_invalid` - `features/consolidated_misc.feature` — scenarios around lines 255–280 - **Severity**: High — unit tests for core A2A model validation are broken and will fail at runtime. - **Related Epic**: #933 — A2A Protocol Compliance — JSON-RPC 2.0 Framing, Standard Operations, and Extension Methods ## Subtasks - [ ] Audit `features/steps/a2a_facade_steps.py` for all stale pre-JSON-RPC-2.0 field references - [ ] Update `step_request_has_id` to access `context.request.id` instead of `context.request.request_id` - [ ] Update `step_request_version` to access `context.request.jsonrpc` and assert value `"2.0"` instead of `context.request.a2a_version` - [ ] Update `step_create_response` to construct `A2aResponse(id=rid, result=...)` instead of `A2aResponse(request_id=rid, status=status)` - [ ] Update `step_create_response_invalid` to construct `A2aResponse(id=..., error=...)` instead of `A2aResponse(request_id=..., status=...)` - [ ] Verify all three affected scenarios in `features/consolidated_misc.feature` pass without `AttributeError` - [ ] Verify no regressions in other A2A Behave scenarios - [ ] Run `nox` (all default sessions) and fix any errors - [ ] Verify coverage >= 97% via `nox -s coverage_report` ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly (`fix(a2a): update Behave step definitions to use JSON-RPC 2.0 field names`), followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly (`fix/a2a-step-definitions-jsonrpc2-field-names`). - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - All nox stages pass. - Coverage >= 97%. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.7.0 milestone 2026-04-03 04:19:59 +00:00
freemo self-assigned this 2026-04-03 16:58:03 +00:00
Author
Owner

MoSCoW classification: Must Have

Rationale: This issue addresses a core spec requirement or blocks critical functionality. The project cannot ship without this fix.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

MoSCoW classification: **Must Have** Rationale: This issue addresses a core spec requirement or blocks critical functionality. The project cannot ship without this fix. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#2132
No description provided.