Skip to content

feat(a2a): promote context IDs for classifier routing#226

Open
nerdalert wants to merge 1 commit into
praxis-proxy:mainfrom
nerdalert:brent-ai-a2a-context-extraction
Open

feat(a2a): promote context IDs for classifier routing#226
nerdalert wants to merge 1 commit into
praxis-proxy:mainfrom
nerdalert:brent-ai-a2a-context-extraction

Conversation

@nerdalert

Copy link
Copy Markdown
Member

Summary

Adds support for A2A’s standard contextId field, which groups related messages and tasks. Praxis now extracts contextId from request bodies and promotes it into safe internal routing metadata, so operators can route and observe A2A traffic by context when clients provide one. Requests without a context ID still pass normally. This PR does not store contextId -> backend ownership yet; it only makes context visible so a follow-up can add stateful context routing if needed.

This PR extracts context IDs from spec-defined request locations:

  • SendMessage: params.message.contextId
  • SendStreamingMessage: params.message.contextId
  • ListTasks: params.contextId

When present and safe, the value is promoted to durable metadata, filter results, and the configured internal header, defaulting to x-praxis-a2a-context-id.

Scope

This is classifier metadata only. It enables configured router matches on contextId, but does not add automatic contextId backend ownership state, Valkey storage, or stateful context-based follow-up routing. The only thing intentionally not tested is stateful context ownership, because that is out of scope. This PR only promotes request metadata; it does not store contextId -> cluster mappings.

Validation

  • cargo test -p praxis-ai-filters a2a
  • cargo clippy -p praxis-ai-filters -- -D warnings
  • make lint
  • cargo +nightly fmt --all --check
  • git diff --check

References

Refs #148
Refs #157
A2A spec: https://a2a-protocol.org/latest/specification/

Signed-off-by: Brent Salisbury <bsalisbu@redhat.com>
@nerdalert nerdalert requested review from a team and alexsnaps July 2, 2026 04:32
@nerdalert nerdalert requested a review from shaneutt as a code owner July 2, 2026 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant