Conversation
Signed-off-by: wangshun <96341168+xixi-box@users.noreply.github.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.
Fixes #3787
Summary
A2A returned permission errors for some inaccessible tasks and contexts, which let callers distinguish them from missing resources. The shared Session resolver now returns
TASK_NOT_FOUNDwhen a Session is unreadable or belongs to another Agent. A2A 1.0.1 error handlingWhen an operation is denied, the resolver checks whether the caller can read the Session on the selected Agent before returning a permission error. This preserves the permission response when a read-only share recipient tries to mutate a conversation they can read. A grant for the requested operation still authorizes that operation directly.
Fixes #3787
Testing
Tests:
/bin/sh -c 'cd go && go test -race -count=1 -v ./core/internal/a2agateway ./core/internal/grpcserver -run '"'"'^(TestGatewayMissingConversationAcrossTransports|TestHTTPAgentURLIsAuthoritative|TestGatewayReadOnlySharesAcrossTransports|TestRuntimeTaskStoreThroughGRPC)$'"'"''.Result: cd go && go test -race -count=1 ./core/internal/service/session ./core/internal/a2agateway: both packages passed with the original tests.
Result: Regression command on unchanged implementation with the regression assertions: exited 1 with the expected permission error in both transport tests and the PostgreSQL-backed cross-Agent GetTask case. See OSSCOUT_BASE.log.
Result: Regression command on patched implementation: exited 0 for both the A2A gateway and PostgreSQL-backed gRPC integration suite. See OSSCOUT_PATCHED.log.
Result: cd go && go test -race -count=1 -v ./core/internal/grpcserver -run '^(TestA2AShareAuthorizationIsDelegatedToGateway|TestActorAndUserPoliciesOnSharedEndpoint|TestAuthenticationUnaryInterceptor)$': passed.
Result: The first patched run of both affected packages passed Session but failed the stale permission-denied expectation in TestHTTPActorA2AUsesSessionAuthorization. The denied actor cannot read that Session, so its expected response now follows the not-found contract.
Result: cd go && go test -race -count=1 ./core/internal/service/session ./core/internal/a2agateway: final run passed both full packages (56.197s and 11.800s).
Result: GOFLAGS=-race make -C go lint LINT_ARGS='./core/internal/service/session ./core/internal/a2agateway ./core/internal/grpcserver': passed with 0 issues on the final diff.
Regression coverage:
go/core/internal/grpcserver/task_store_test.go.