Repository navigation
Conversation
erauner12
force-pushed
the
fix-adk-preserve-a2a-user-identity
branch
from
August 17, 2026 18:57
9eadec9 to
409d7f9
Compare
Signed-off-by: Evan Rauner <[email protected]>
erauner12
force-pushed
the
fix-adk-preserve-a2a-user-identity
branch
from
August 17, 2026 19:21
409d7f9 to
cb75094
Compare
Owner
Author
CI statusThe failing go-unit-tests and previous-stable upgrade checks reproduce unchanged on the PR base commit (bc92b68) in upstream main: https://github.com/kagent-dev/kagent/actions/runs/32034286380.
These failures are therefore unrelated to the changed packages in this PR. The checks can be rerun or the branch rebased after the upstream base-branch failures are resolved. |
Signed-off-by: Evan Rauner <[email protected]>
Owner
Author
|
Superseded for |
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
Preserve the initiating A2A user identity in the context returned by the Go runtime call interceptor, so pre-executor task-store callbacks observe the same authenticated user as CallContext.User.
Problem
UserIDCallInterceptor.Before already reads x-user-id from the authenticated A2A request and assigns it to CallContext.User, but it returned the original context unchanged.
Task resolution can occur before KAgentExecutor.Execute adds identity to the invocation context. Pre-executor TaskStore.Get and TaskStore.Save callbacks that read identity from context.Context could therefore fall back to the runtime service identity. This breaks owner-scoped access when a persisted continuation arrives in a later request or process.
Change
userIDInterceptor.Before now returns auth.WithUserID(ctx, userID) after populating CallContext.User. Both identity access paths therefore carry the same authenticated user before stored-task resolution begins.
Trust boundary
This does not add a new identity source or broaden trust in caller-controlled metadata. The interceptor already accepts the authenticated service parameter and exposes it as CallContext.User; this change makes the returned Go context consistent with that existing call identity.
Contract protected
A persisted A2A continuation is a new request. Runtime task callbacks must reconstruct the authenticated owner on every request rather than relying on executor-local state from the original invocation.
The regression test protects both CallContext.User and auth.UserIDFromContext(returnedContext). This server-side contract remains relevant even when an in-repository UI does not exercise cross-process A2A continuation.
Scope and companion seams
This PR changes only the Go ADK runtime context lifecycle. It does not:
The controller forwarding and runtime context changes are independently testable but complementary for Go-runtime persisted resume.
Changed files
Tests
Validation status
The Go-specific behavior is directly covered by the interceptor regression test. Combined controller-route validation performed with a Python declarative runtime is intentionally not presented as live proof of this Go-only change.
Intended upstream issue: kagent-dev/kagent#2465.