Skip to content

[Bug]: SendMessage does not return an error when taskId and contextId are mismatched #723

@jmesnil

Description

@jmesnil

What happened?

Summary

The SUT accepts a SendMessage request with a taskId and a mismatching contextId instead of rejecting it with an error (JSON-RPC transport).

Requirement

Specification

Agents MUST reject messages containing mismatching contextId and taskId (i.e., the provided contextId is different from that of the referenced Task).

Expected behavior

When a client sends a SendMessage with a taskId referencing an existing task and a contextId that does not match that task's context, the agent must return an error.

Actual behavior

The SUT accepts the message and returns a success response instead of an error.

Reproducer

# Step 1: Create a task to get a valid taskId and contextId
curl -s -X POST http://localhost:9999 \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "SendMessage",
    "params": {
      "message": {
        "role": "ROLE_USER",
        "parts": [{"text": "hello"}],
        "messageId": "tck-setup-001"
      }
    }
  }'
# Note the taskId and contextId from the response.

# Step 2: Send a follow-up with the correct taskId but a WRONG contextId
# Replace <TASK_ID> with the taskId from Step 1.
curl -s -X POST http://localhost:9999 \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 2,
    "method": "SendMessage",
    "params": {
      "message": {
        "role": "ROLE_USER",
        "parts": [{"text": "Mismatched context test"}],
        "messageId": "tck-mismatch-001",
        "taskId": "<TASK_ID>",
        "contextId": "wrong-context-does-not-exist"
      }
    }
  }'
# Expected: a JSON-RPC error response
# Actual:   a success response with a Task/StatusEvent

TCK test

tests/compatibility/core_operations/test_task_lifecycle.py::TestMultiTurn::test_reject_mismatching_context

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    compatibilityIssue related to A2A compatibility

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions