Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public final class A2AHttpClientFactory {
private static final List<A2AHttpClientProvider> PROVIDERS;

static {
PROVIDERS = StreamSupport.stream(ServiceLoader.load(A2AHttpClientProvider.class).spliterator(), false)
PROVIDERS = StreamSupport.stream(ServiceLoader.load(A2AHttpClientProvider.class, A2AHttpClientProvider.class.getClassLoader()).spliterator(), false)
Comment thread
kabir marked this conversation as resolved.
.collect(Collectors.toList());
}

Expand Down Expand Up @@ -85,7 +85,8 @@ public static A2AHttpClient create(String providerName) {
throw new IllegalArgumentException("Provider name must not be null or empty");
}

ServiceLoader<A2AHttpClientProvider> loader = ServiceLoader.load(A2AHttpClientProvider.class);
ServiceLoader<A2AHttpClientProvider> loader =
ServiceLoader.load(A2AHttpClientProvider.class, A2AHttpClientProvider.class.getClassLoader());

return StreamSupport.stream(loader.spliterator(), false)
.filter(provider -> providerName.equals(provider.name()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import org.a2aproject.sdk.spec.TaskNotFoundError;
import org.a2aproject.sdk.spec.TaskPushNotificationConfig;
import org.a2aproject.sdk.spec.TaskQueryParams;
import org.a2aproject.sdk.spec.AgentInterface;
import org.a2aproject.sdk.spec.TransportProtocol;
import org.a2aproject.sdk.spec.A2AErrorCodes;
import org.a2aproject.sdk.spec.UnsupportedOperationError;
Expand Down Expand Up @@ -686,7 +687,11 @@ private <V> ServerCallContext createCallContext(StreamObserver<V> responseObserv
}

// Extract requested protocol version from gRPC context (set by interceptor)
// Default to current version since gRPC only handles 1.0 protocol
String requestedVersion = getVersionFromContext();
if (requestedVersion == null) {
requestedVersion = AgentInterface.CURRENT_PROTOCOL_VERSION;
}

// Extract requested extensions from gRPC context (set by interceptor)
Set<String> requestedExtensions = new HashSet<>();
Expand Down