Skip to content

refactor: adopt A2A v1.0.1 method names via adk v0.31.0 - #133

Merged
edenreich merged 2 commits into
mainfrom
refactor/issue-132-20261003-1929
Oct 3, 2026
Merged

edenreich merged 2 commits into
mainfrom
refactor/issue-132-20261003-1929

Conversation

@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor

Summary

Bumps github.com/inference-gateway/adk from v0.29.0 to v0.31.0 and refactors the debugger onto the A2A v1.0.1 JSON-RPC surface. The v0.x slash method names no longer exist anywhere in cli/ or the README - every error label now comes from the generated types.A2AMethod* constants.

Method name constants

handleA2AError now takes a types.A2AMethod instead of a free-form string, so the compiler rejects stray literals. Call sites use types.A2AMethodListTasks, types.A2AMethodGetTask, types.A2AMethodSendMessage, types.A2AMethodSendStreamingMessage and types.A2AMethodGetExtendedAgentCard. The one non-JSON-RPC label left is the public agent card fetch, which is a plain HTTP GET on the well-known path - it uses a named agentCardMethod constant rather than a slash name.

Renamed request/response types in v0.31.0

The ADK regenerated its types alongside the method rename, so the client call sites moved too:

v0.x v1.0.1
types.MessageSendParams types.SendMessageRequest
types.TaskListParams types.ListTasksRequest
types.TaskQueryParams types.GetTaskRequest
types.TaskList types.ListTasksResponse
types.TaskIdParams types.CancelTaskRequest
types.TaskResubscriptionParams types.SubscribeToTaskRequest
types.GetAuthenticatedExtendedCardParams types.GetExtendedAgentCardRequest
types.*PushNotificationConfigParams types.*PushNotificationConfig*Request

Other adaptations:

  • Pagination is now token-based (PageSize / PageToken instead of Limit / Offset). The --limit and --offset flags are preserved: the ADK encodes the offset in the opaque page token, so --offset is passed through as the page token.
  • TaskListParams.State is now ListTasksRequest.Status.
  • Extended card support moved from AgentCard.SupportsExtendedAgentCard to AgentCard.Capabilities.ExtendedAgentCard.
  • SendMessage now returns a SendMessageResponse wrapping the task, while GetTask still returns a bare Task. taskFromResult handles both and is reused by tasks submit.
  • Task.ContextID became *string; call sites use Task.GetContextID().
  • types.TaskStateCancelled is now types.TaskStateCanceled.
  • Part.File was replaced by the flattened Filename / URL / Raw / MediaType fields.

Typed streaming events

submit-streaming and the interactive chat UI no longer guess the event kind by probing for artifact / final / id keys. v0.31.0 ships a typed types.StreamResponse wrapper, so each event is decoded once and dispatched on whichever of StatusUpdate / ArtifactUpdate / Task / Message is non-nil. This removes the repeated re-unmarshalling in both switches and adds handling for the previously-unsupported Message event kind. The [FINAL] marker is gone because TaskStatusUpdateEvent no longer carries a final field - the stream ending is signalled by the channel closing.

Streaming test fixtures were rewritten from hand-rolled map[string]any payloads to typed types.StreamResponse values, so they now match the wire shape the ADK actually emits.

Verification

  • go build ./... passes
  • go vet ./... passes
  • go test ./... passes
  • go mod tidy leaves the module files clean
  • go fmt ./... reports no changes

golangci-lint run could not be executed in this sandbox (the command is not allow-listed), so CI is the first lint signal.

The end-to-end acceptance criterion ("every debugger command works against a v0.31.0 ADK agent") was not exercised here - example/docker-compose.yml needs a container runtime that is unavailable in this environment. The push-notification-config methods are only stubbed in the test mock and are not reachable from any CLI command, so they are renamed but untested.

Downstream impact

The streaming output changed slightly for users ([FINAL] marker removed, new Agent Message event line), and the debugger now requires an ADK v0.31.0 agent - v0.x agents will answer every call with -32601. A [DOCS] issue is filed on inference-gateway/docs to cover the version requirement.

Closes #132

@edenreich

Copy link
Copy Markdown
Contributor

@claude can you bump the version of the adk to latest and also verify the examples work as expected? use /ponytail:ponytail /go /go-concurrency /domain-driven-design

@inference-gateway-maintainer

inference-gateway-maintainer Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Claude finished @edenreich's task in 10m 57s —— View job


Done

  • Check latest adk version - v0.32.1 (released today, 2 patches + 1 minor past the PR's v0.31.0)
  • Bump adk - clean bump, no API surface moved; v0.32.0/v0.32.1 are internal server/type refactors
  • go build / go vet / go test / go fmt / go mod tidy all clean
  • Verify the example commands work against a real agent
  • Fix the two defects that verification turned up
  • Commit (3310a41)

Verifying the example

Docker is not allow-listed in this runner, so example/docker-compose.yml could not be brought up. Instead I added cli/e2e_test.go, which boots a real adk/server (v0.32.1) on a free port with an echo handler and drives rootCmd over the wire through the command list the example README documents: connect, agent-card, tasks submit, tasks get, tasks list (plain, and with --state/--context-id), tasks history, tasks submit-streaming, and --raw. That makes the acceptance criterion the PR body said it could not exercise ("every debugger command works against a v0.31.0 ADK agent") run in task test from now on.

I also confirmed inference-gateway/mock-agent (the image the example uses) is itself already on adk v0.32.1, so the example's two halves are on the same ADK.

Two real defects the verification found

Both are v1.0.1 enum-rename fallout the original refactor missed - the states went from completed to TASK_STATE_COMPLETED.

1. --state silently matched nothing. cli/cli.go passed the flag through as types.TaskState(state), so the README's documented tasks list --state working sent "working", which is no longer a valid state - the filter matched zero tasks with no error. Now normalized via taskStateFromFlag (working / input-required / TASK_STATE_FAILED all accepted) and rejected up front with invalid --state %q when it is not a real state, instead of returning an empty list.

2. Raw enum values leaked into the human-facing streaming output. submit-streaming printed Status Update: TASK_STATE_WORKING and Final Status: TASK_STATE_WORKING, while the README documents Final Status: completed. These now go through the humanState helper that already existed for the interactive UI.

While in there: the task-snapshot event prints the task's status.message, which at TASK_STATE_SUBMITTED is the user's own prompt - it was labelled 💬 Agent Response. Now labelled by role, so a snapshot shows 💬 User Message.

Things worth your call

  • The e2e test imports adk/server, which pulls gin / otel / minio / redis / mongo into the root go.mod as test-only indirects. The shipped binary imports none of them so go install never fetches them, but it is a noisier go.mod. The alternative is a separate e2e/ module, which would have to drive the compiled binary rather than rootCmd (the test needs package-private access) and would not run under task test without a workflow change I cannot make. I took the simpler one; say the word if you want it split out.
  • golangci-lint is not allow-listed in this sandbox either, so CI is still the first lint signal. I matched the gci section order and the importas alias rule by hand - note that rule derives sdk for github.com/cloudevents/sdk-go/v2 and config for adk/server/config, which is why those aliases read oddly in the new test.
  • The push-notification-config methods remain unreachable from any CLI command, so they are still renamed-but-untested, as the PR body already noted.
    | branch refactor/issue-132-20261003-1929

@edenreich
edenreich merged commit 18f5323 into main Oct 3, 2026
1 check passed
@edenreich
edenreich deleted the refactor/issue-132-20261003-1929 branch October 3, 2026 20:18
inference-gateway-releaser Bot added a commit that referenced this pull request Oct 3, 2026
## [0.11.0](v0.10.0...v0.11.0) (2026-10-03)

### ✨ Features

* **auth:** add auth command and credential flags ([#114](#114)) ([b40e02a](b40e02a))

### ♻️ Improvements

* adopt A2A v1.0.1 method names via adk v0.31.0 ([#133](#133)) ([18f5323](18f5323))

### 👷 CI

* **claude:** centralize claude.yml via reusable workflow ([#123](#123)) ([c64f10f](c64f10f))
* **claude:** centralize claude.yml via reusable workflow ([#126](#126)) ([d2c0b71](d2c0b71))

### 📚 Documentation

* **agents:** refresh AGENTS.md for current code layout ([#118](#118)) ([efee952](efee952))

### 🔧 Miscellaneous

* **deps:** bump claude-code 2.1.245 -> 2.1.266 ([#112](#112)) ([2c185f0](2c185f0))
* **deps:** bump claude-code 2.1.266 -> 2.1.278 ([#121](#121)) ([8a66dea](8a66dea))
* **deps:** bump claude-code 2.1.278 -> 2.1.280 ([#124](#124)) ([de903b9](de903b9))
* **deps:** bump claude-code 2.1.280 -> 2.1.283 ([#127](#127)) ([9fc5ace](9fc5ace))
* **deps:** bump claude-code 2.1.283 -> 2.1.285 ([#131](#131)) ([b2b57c2](b2b57c2))
* **deps:** bump infer CLI v0.183.0 -> v0.192.0 ([#113](#113)) ([58338f7](58338f7))
* **deps:** bump infer CLI v0.192.0 -> v0.205.3 ([#122](#122)) ([dcc41b7](dcc41b7))
* **deps:** bump infer CLI v0.205.3 -> v0.208.0 ([#125](#125)) ([921b772](921b772))
* **deps:** bump infer CLI v0.208.0 -> v0.218.0 ([#128](#128)) ([b1dbfed](b1dbfed))
* **deps:** bump infer CLI v0.218.0 -> v0.221.1 ([#130](#130)) ([775c18c](775c18c))
* **lint:** enforce Go import grouping and named imports with gci and importas ([#117](#117)) ([ca24b08](ca24b08)), closes [#116](#116)

### 🔨 Miscellaneous

* **deps:** bump docker/setup-buildx-action in the github-actions group ([#120](#120)) ([2c42a52](2c42a52))
* **deps:** bump github.com/inference-gateway/adk in the gomod group ([#115](#115)) ([479f614](479f614))
* **deps:** bump github.com/inference-gateway/adk in the gomod group ([#119](#119)) ([e8bf20c](e8bf20c))
* **deps:** bump github.com/inference-gateway/adk in the gomod group ([#129](#129)) ([d1b7019](d1b7019))
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.11.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TASK] Refactor JSON-RPC method names to A2A v1.0.1

1 participant