Skip to content

Conversation

@EugeneTheDev
Copy link
Collaborator

@EugeneTheDev EugeneTheDev commented Sep 29, 2025

Introduce initial version of A2A SDK and Koog agent A2A integration:

  1. Multiplatform Kotlin A2A SDK, including server and client. Only JSON-RPC HTTP for now.
  2. Integration tests for A2A SDK using A2A Protocol Technology Compatibility Kit (TCK). All tests pass.

@EugeneTheDev EugeneTheDev force-pushed the a2a-support branch 4 times, most recently from 9128245 to ea01449 Compare September 30, 2025 13:40
Copy link
Contributor

@kpavlov kpavlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just notes

* Retrieves [AgentCard] by calling [AgentCardResolver.resolve].
* Saves it to the cache.
*/
public open suspend fun getAgentCard(): AgentCard {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: As a User, I would expect this method to use cache transparently.
Maybe use cache TTL and/or introduce refreshAgentCard()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regular getAgentCard already refreshes the cache, because it uses resoslver every time. And so is get authenticated card. cached card is a convenience method to get local version of the card without fetching it

request: Request<Nothing?>,
ctx: ClientCallContext = ClientCallContext.Default
): Response<AgentCard> {
check(getAgentCard().supportsAuthenticatedExtendedCard == true) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method bypasses cache

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

request: Request<MessageSendParams>,
ctx: ClientCallContext = ClientCallContext.Default
): Response<CommunicationEvent> {
return transport.sendMessage(request, ctx)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

future improvement: check supported features and fail when operation is not supported

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already do this, e.g. streaming and push notifications

contentType(ContentType.Application.Json)
}

install(ContentNegotiation) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Needs logging also

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logging is definitely needed everywhere in A2A, will add this separately later

@@ -0,0 +1,476 @@
package ai.koog.a2a.model
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: annotations, consts, and utils packages are plural, model and transport are single. Maybe rename for consistency?

@JvmInline
@Serializable
public value class TransportProtocol(public val value: String) {
@Suppress("MissingKDocForPublicAPI")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe, let's generate the KDoc

@EugeneTheDev EugeneTheDev force-pushed the a2a-support branch 2 times, most recently from 910e9b2 to cefa010 Compare September 30, 2025 16:18
@Ololoshechkin Ololoshechkin self-requested a review October 1, 2025 13:56
Copy link
Collaborator

@Ololoshechkin Ololoshechkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗿

@EugeneTheDev EugeneTheDev marked this pull request as ready for review October 1, 2025 15:16
ctx: ClientCallContext = ClientCallContext.Default
): Response<AgentCard> {
check(getAgentCard().supportsAuthenticatedExtendedCard == true) {
check(cachedAgentCard().supportsAuthenticatedExtendedCard == true) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@github-actions
Copy link

github-actions bot commented Oct 1, 2025

Qodana for JVM

1003 new problems were found

Inspection name Severity Problems
Check Kotlin and Java source code coverage 🔶 Warning 958
Vulnerable imported dependency 🔶 Warning 30
Missing KDoc for public API declaration 🔶 Warning 9
Unused import directive 🔶 Warning 6
@@ Code coverage @@
+ 71% total lines covered
14234 lines analyzed, 10107 lines covered
# Calculated according to the filters of your coverage tool

☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]

@EugeneTheDev EugeneTheDev changed the title [KG-4] A2A [KG-4] Initial version of A2A SDK and integration Oct 1, 2025
@EugeneTheDev EugeneTheDev merged commit d9ed920 into develop Oct 1, 2025
36 of 44 checks passed
@EugeneTheDev EugeneTheDev deleted the a2a-support branch October 1, 2025 20:40
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.

4 participants