feat(a2a): promote context IDs for classifier routing#226
Open
nerdalert wants to merge 1 commit into
Open
Conversation
Signed-off-by: Brent Salisbury <bsalisbu@redhat.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.contextIdSendStreamingMessage:params.message.contextIdListTasks:params.contextIdWhen 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 a2acargo clippy -p praxis-ai-filters -- -D warningsmake lintcargo +nightly fmt --all --checkgit diff --checkReferences
Refs #148
Refs #157
A2A spec: https://a2a-protocol.org/latest/specification/