Repository navigation
feat: extend the AgentInstance A2A gateway - #2478
Merged
Merged
Conversation
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds persisted, revision-pinned Agent Cards for AgentInstances by storing the compiled Agent Card JSON on each runtime_revision, exposing an authenticated “extended” Agent Card from the gateway based on the AgentInstance’s pinned revision, and making the gateway’s public gRPC URL configurable via Helm.
Changes:
- Add a new
runtime_revision.agent_cardJSONB column and plumb it through SQLC-generated queries/models and the Postgres client. - Persist the compiled Agent Card JSON during v2 controller reconciliation and serve the authenticated extended Agent Card from the gateway using the AgentInstance’s
PreparedRevision. - Add
controller.a2aGatewayUrlHelm value + templating and tests to advertise the gateway gRPC endpoint viaA2A_GATEWAY_URL.
Reviewed changes
Copilot reviewed 14 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| helm/kagent/values.yaml | Adds controller.a2aGatewayUrl Helm value for the advertised public gateway URL. |
| helm/kagent/tests/controller-deployment_test.yaml | Adds Helm unit tests asserting A2A_GATEWAY_URL defaulting and overrides. |
| helm/kagent/templates/controller-configmap.yaml | Injects A2A_GATEWAY_URL into the controller ConfigMap. |
| helm/kagent/templates/_helpers.tpl | Adds kagent.a2aGatewayUrl helper to compute the advertised gateway URL. |
| go/core/v2/controller/reconciler.go | Persists compiled AgentCardJSON into RuntimeRevision during reconciliation. |
| go/core/v2/a2agateway/gateway.go | Implements GetExtendedAgentCard by loading the pinned runtime_revision.agent_card and overlaying gateway-owned fields. |
| go/core/v2/a2agateway/gateway_test.go | Adds coverage ensuring the gateway serves template metadata from the pinned revision and uses the public gateway URL. |
| go/core/pkg/migrations/core/000013_runtime_revision_agent_card.up.sql | Adds agent_card JSONB column to runtime_revision. |
| go/core/pkg/migrations/core/000013_runtime_revision_agent_card.down.sql | Drops the agent_card column. |
| go/core/internal/database/queries/runtime_revisions.sql | Extends runtime revision upsert to include agent_card. |
| go/core/internal/database/gen/runtime_revisions.sql.go | Regenerates SQLC code to read/write agent_card. |
| go/core/internal/database/gen/models.go | Adds AgentCard []byte to SQLC RuntimeRevision model. |
| go/core/internal/database/gen/agent_instances.sql.go | Includes agent_card when selecting latest runtime revision for an instance. |
| go/core/internal/database/client_postgres.go | Maps AgentCard between API model and SQLC params/rows. |
| go/core/internal/database/client_agent_instance_test.go | Verifies AgentCard is persisted and retrievable from GetRuntimeRevision. |
| go/core/cmd/controller-v2/main.go | Wires A2A_GATEWAY_URL env var into the gateway constructor. |
| go/api/database/models.go | Adds AgentCard to the shared RuntimeRevision API model. |
Files not reviewed (3)
- go/core/internal/database/gen/agent_instances.sql.go: Generated file
- go/core/internal/database/gen/models.go: Generated file
- go/core/internal/database/gen/runtime_revisions.sql.go: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+295
to
+304
| revision, err := g.store.GetRuntimeRevision(ctx, instance.GetPreparedRevision()) | ||
| if err != nil { | ||
| ctrllog.FromContext(ctx).Error(err, "failed to load AgentInstance runtime revision", "revision", instance.GetPreparedRevision()) | ||
| return nil, a2atype.NewError(a2atype.ErrInternalError, "failed to load Agent Card") | ||
| } | ||
| card := &a2atype.AgentCard{} | ||
| if err := json.Unmarshal(revision.AgentCard, card); err != nil { | ||
| ctrllog.FromContext(ctx).Error(err, "failed to decode AgentInstance Agent Card", "revision", revision.Revision) | ||
| return nil, a2atype.NewError(a2atype.ErrInternalError, "failed to load Agent Card") | ||
| } |
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
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
The public
.well-known/agent-card.jsonrouting contract, authorization coverage, and new lifecycle tests remain deferred.Validation
go test ./core/v2/a2agatewaymake -C go lintgit diff --check