Tools and state

a2a

Extracts A2A protocol metadata from JSON-RPC request bodies and promotes method, family, task ID, streaming detection, and version to request headers, filter results, and durable metadata for routing.

Praxis AI v0.12.1 (alpha) 3 min read
On this page

Extracts A2A protocol metadata from JSON-RPC request bodies and promotes method, family, task ID, streaming detection, and version to request headers, filter results, and durable metadata for routing.

Configuration Notes

When task_routing.enabled is true, the filter captures task and context ownership from backend responses and uses it to route follow-up requests. Task-owner routing sends GetTask, CancelTask, SubscribeToTask, and push-notification config methods back to the backend that created the task. Context-owner routing sends ListTasks, SendMessage, and SendStreamingMessage requests carrying a known contextId back to the backend that owns the context. Task-ID routes take precedence over context-ID routes. Context routes always use ttl_seconds; a completed task does not evict the context route.

Configuration

FieldTypeRequiredDescription
headersobjectnoHeader names for A2A metadata promotion. Must not be hop-by-hop, framing, Host, credential, API-key, or other internal x-praxis-* names. Dedicated x-praxis-a2a-* defaults remain allowed.
headers.context_idstringnoHeader name for the extracted context ID (e.g. x-praxis-a2a-context-id).
headers.familystringnoHeader name for the A2A family (e.g. x-praxis-a2a-family).
headers.kindstringnoHeader name for the JSON-RPC kind (e.g. x-praxis-a2a-kind).
headers.methodstringnoHeader name for the canonical A2A method (e.g. x-praxis-a2a-method).
headers.streamingstringnoHeader name for streaming detection (e.g. x-praxis-a2a-streaming).
headers.task_idstringnoHeader name for the extracted task ID (e.g. x-praxis-a2a-task-id).
headers.versionstringnoHeader name for A2A version (e.g. x-praxis-a2a-version).
max_body_bytesintegernoMaximum body size in bytes for StreamBuffer.
method_aliasesobject<string, string>noMethod aliases for compatibility (slash-delimited → PascalCase).
on_invalidcontinue | reject | errornoInvalid input handling behavior.
task_routingobjectnoTask-ownership routing configuration.
task_routing.enabledboolnoWhether task routing is enabled.
task_routing.max_response_body_bytesintegernoMaximum response body bytes to buffer for task route capture.
task_routing.on_lookup_misscontinuenoBehavior when a task route lookup misses.
task_routing.route_cluster_headerstringnoInternal header name injected on task or context route hit.
task_routing.storelocalnoStorage backend for task routes. Required when task routing is enabled.
task_routing.terminal_ttl_secondsintegernoTTL in seconds for terminal task routes (0 = remove immediately). Must be at most 2,592,000 (30 days).
task_routing.ttl_secondsintegernoTTL in seconds for non-terminal task routes. Must be greater than 0 and at most 2,592,000 (30 days).

Examples

Example 1

filter: a2a

Example 2

filter: a2a
max_body_bytes: 65536
on_invalid: reject
method_aliases:
  message/send: SendMessage
  message/stream: SendStreamingMessage
  tasks/get: GetTask
  tasks/cancel: CancelTask
headers:
  method: x-praxis-a2a-method
  family: x-praxis-a2a-family
  context_id: x-praxis-a2a-context-id
  task_id: x-praxis-a2a-task-id
  kind: x-praxis-a2a-kind
  streaming: x-praxis-a2a-streaming
  version: x-praxis-a2a-version
task_routing:
  enabled: true
  store: local
  route_cluster_header: x-praxis-a2a-route-cluster
  ttl_seconds: 3600
  terminal_ttl_seconds: 300
  max_response_body_bytes: 65536