UAT: cleveragents.a2a.asgi:app ASGI application only serves health probe endpoints — missing the A2A JSON-RPC 2.0 endpoint required for server mode #2159

Closed
opened 2026-04-03 04:32:34 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/asgi-app-missing-a2a-jsonrpc-endpoint
  • Commit Message: fix(a2a): expose A2A JSON-RPC 2.0 endpoint in ASGI application for server mode
  • Milestone: v3.7.0
  • Parent Epic: #933

Background

The specification states:

"The server shares the same Domain and Application layers as the client (per ADR-001), differing only in Infrastructure and Presentation layers. Its sole client-facing interface is an A2A JSON-RPC 2.0 endpoint — there is no REST API."

And:

"In server mode, A2A flows over HTTP to the CleverAgents server. All communication — both agent conversations and platform operations — flows through the single A2A JSON-RPC 2.0 endpoint."

The agents server serve command uses cleveragents.a2a.asgi:app as the ASGI application target.

Expected behavior (per spec): The ASGI application must expose an A2A JSON-RPC 2.0 endpoint (e.g., POST /) that accepts JSON-RPC 2.0 requests and routes them to the appropriate handlers. This is the server's sole client-facing interface.

Actual behavior: The cleveragents.a2a.asgi:app ASGI application only serves 4 health/readiness probe endpoints:

  • GET /{"service":"cleveragents"}
  • GET /live{"status":"alive"}
  • GET /ready{"status":"ready"}
  • GET /health{"status":"ok"}

There is no POST / or any other endpoint that accepts A2A JSON-RPC 2.0 requests. Any POST request to / returns 405 Method Not Allowed. The server cannot process any A2A operations.

Code location: src/cleveragents/a2a/asgi.py — the app() ASGI function only handles GET requests to 4 health paths. No JSON-RPC dispatch logic exists.

Steps to reproduce:

# Start the server
agents server serve --port 8080

# Try to send an A2A request
curl -X POST http://localhost:8080/ \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":"1","method":"_cleveragents/health/check","params":{}}'
# Returns: 405 Method Not Allowed

Severity: Critical — the server mode ASGI application cannot process any A2A requests. Server mode is completely non-functional for actual agent communication.

Note: This is understood to be a stub/placeholder implementation. However, the spec is the source of truth, and the gap must be tracked as a bug.

Subtasks

  • Write a failing Behave scenario that sends a POST / JSON-RPC 2.0 request to the ASGI app and asserts a valid JSON-RPC 2.0 response (TDD — commit failing test first)
  • Write a failing Robot Framework integration test that starts the server and verifies POST / accepts A2A JSON-RPC 2.0 requests
  • Add POST / route to src/cleveragents/a2a/asgi.py that accepts application/json requests
  • Implement JSON-RPC 2.0 request parsing and validation (validate jsonrpc, id, method, params fields)
  • Wire the JSON-RPC dispatcher to route incoming method values to the appropriate A2A handler (or return method not found error for unimplemented methods)
  • Ensure health probe endpoints (GET /, GET /live, GET /ready, GET /health) are preserved alongside the new POST / A2A endpoint
  • Return well-formed JSON-RPC 2.0 error responses ({"jsonrpc":"2.0","id":...,"error":{"code":...,"message":...}}) for invalid requests
  • Run nox -e lint and nox -e typecheck — fix all errors
  • Run nox -e unit_tests and nox -e integration_tests — fix all failures
  • Verify nox -e coverage_report reports coverage >= 97%
  • Run full nox suite — all sessions must pass

Definition of Done

  • A failing Behave test reproducing the bug is committed to master before the fix (TDD requirement)
  • POST / on cleveragents.a2a.asgi:app accepts valid JSON-RPC 2.0 requests and returns valid JSON-RPC 2.0 responses
  • Invalid or malformed JSON-RPC 2.0 requests return well-formed JSON-RPC 2.0 error responses
  • Health probe endpoints (GET /, GET /live, GET /ready, GET /health) continue to function correctly
  • All Behave unit test scenarios pass (nox -e unit_tests)
  • All Robot Framework integration tests pass (nox -e integration_tests)
  • Pyright type checking passes with zero errors (nox -e typecheck)
  • Ruff linting passes (nox -e lint)
  • All nox stages pass
  • Coverage >= 97%
  • PR merged to master and this issue closed

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

## Metadata - **Branch**: `fix/asgi-app-missing-a2a-jsonrpc-endpoint` - **Commit Message**: `fix(a2a): expose A2A JSON-RPC 2.0 endpoint in ASGI application for server mode` - **Milestone**: v3.7.0 - **Parent Epic**: #933 ## Background The specification states: > "The server shares the same Domain and Application layers as the client (per ADR-001), differing only in Infrastructure and Presentation layers. Its sole client-facing interface is an **A2A JSON-RPC 2.0 endpoint** — there is no REST API." And: > "In **server mode**, A2A flows over **HTTP** to the CleverAgents server. All communication — both agent conversations and platform operations — flows through the single A2A JSON-RPC 2.0 endpoint." The `agents server serve` command uses `cleveragents.a2a.asgi:app` as the ASGI application target. **Expected behavior (per spec)**: The ASGI application must expose an A2A JSON-RPC 2.0 endpoint (e.g., `POST /`) that accepts JSON-RPC 2.0 requests and routes them to the appropriate handlers. This is the server's sole client-facing interface. **Actual behavior**: The `cleveragents.a2a.asgi:app` ASGI application only serves 4 health/readiness probe endpoints: - `GET /` → `{"service":"cleveragents"}` - `GET /live` → `{"status":"alive"}` - `GET /ready` → `{"status":"ready"}` - `GET /health` → `{"status":"ok"}` There is no `POST /` or any other endpoint that accepts A2A JSON-RPC 2.0 requests. Any `POST` request to `/` returns `405 Method Not Allowed`. The server cannot process any A2A operations. **Code location**: `src/cleveragents/a2a/asgi.py` — the `app()` ASGI function only handles `GET` requests to 4 health paths. No JSON-RPC dispatch logic exists. **Steps to reproduce**: ```bash # Start the server agents server serve --port 8080 # Try to send an A2A request curl -X POST http://localhost:8080/ \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":"1","method":"_cleveragents/health/check","params":{}}' # Returns: 405 Method Not Allowed ``` **Severity**: Critical — the server mode ASGI application cannot process any A2A requests. Server mode is completely non-functional for actual agent communication. **Note**: This is understood to be a stub/placeholder implementation. However, the spec is the source of truth, and the gap must be tracked as a bug. ## Subtasks - [ ] Write a failing Behave scenario that sends a `POST /` JSON-RPC 2.0 request to the ASGI app and asserts a valid JSON-RPC 2.0 response (TDD — commit failing test first) - [ ] Write a failing Robot Framework integration test that starts the server and verifies `POST /` accepts A2A JSON-RPC 2.0 requests - [ ] Add `POST /` route to `src/cleveragents/a2a/asgi.py` that accepts `application/json` requests - [ ] Implement JSON-RPC 2.0 request parsing and validation (validate `jsonrpc`, `id`, `method`, `params` fields) - [ ] Wire the JSON-RPC dispatcher to route incoming `method` values to the appropriate A2A handler (or return `method not found` error for unimplemented methods) - [ ] Ensure health probe endpoints (`GET /`, `GET /live`, `GET /ready`, `GET /health`) are preserved alongside the new `POST /` A2A endpoint - [ ] Return well-formed JSON-RPC 2.0 error responses (`{"jsonrpc":"2.0","id":...,"error":{"code":...,"message":...}}`) for invalid requests - [ ] Run `nox -e lint` and `nox -e typecheck` — fix all errors - [ ] Run `nox -e unit_tests` and `nox -e integration_tests` — fix all failures - [ ] Verify `nox -e coverage_report` reports coverage >= 97% - [ ] Run full `nox` suite — all sessions must pass ## Definition of Done - [ ] A failing Behave test reproducing the bug is committed to `master` before the fix (TDD requirement) - [ ] `POST /` on `cleveragents.a2a.asgi:app` accepts valid JSON-RPC 2.0 requests and returns valid JSON-RPC 2.0 responses - [ ] Invalid or malformed JSON-RPC 2.0 requests return well-formed JSON-RPC 2.0 error responses - [ ] Health probe endpoints (`GET /`, `GET /live`, `GET /ready`, `GET /health`) continue to function correctly - [ ] All Behave unit test scenarios pass (`nox -e unit_tests`) - [ ] All Robot Framework integration tests pass (`nox -e integration_tests`) - [ ] Pyright type checking passes with zero errors (`nox -e typecheck`) - [ ] Ruff linting passes (`nox -e lint`) - [ ] All nox stages pass - [ ] Coverage >= 97% - [ ] PR merged to `master` and this issue closed --- **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:32:38 +00:00
Author
Owner

Duplicate of #2156.

This issue describes the same problem as #2156 ("ASGI app missing A2A JSON-RPC endpoint and SSE streaming endpoint"). Both report that the ASGI application only serves health probe endpoints and lacks the A2A JSON-RPC dispatch endpoint. #2156 is more comprehensive (also covers SSE streaming), so closing this as a duplicate.


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

**Duplicate of #2156.** This issue describes the same problem as #2156 ("ASGI app missing A2A JSON-RPC endpoint and SSE streaming endpoint"). Both report that the ASGI application only serves health probe endpoints and lacks the A2A JSON-RPC dispatch endpoint. #2156 is more comprehensive (also covers SSE streaming), so closing this as a duplicate. --- **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#2159
No description provided.