Skip to content

refactor(a2a): migrate the A2A client to ADK v0.30.0 (A2A v1.0.1 types) - #1476

Merged
edenreich merged 3 commits into
mainfrom
fix/issue-1474
Oct 2, 2026
Merged

edenreich merged 3 commits into
mainfrom
fix/issue-1474

Conversation

@inference-gateway-maintainer

@inference-gateway-maintainer inference-gateway-maintainer Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Resolves #1474

Summary

Bump github.com/inference-gateway/adk from v0.29.0 to v0.30.0 so the CLI speaks the A2A v1.0.1 wire types that freshly generated agents (adl-cli #452 scaffolds) already send. The three wire-level breakages named in the issue are fixed: the renamed canceled task state, the flattened parts, and the SupportedInterfaces-based agent card. On the open question, the CLI stays tolerant of pre-v1.0.1 task-state spellings: NormalizeTaskState accepts both on read, while everything the CLI sends uses the new shape. Nested data parts and file parts from v0.29-era agents are not read, so their structured errors and file-part artifact URLs are dropped. Text parts and the artifact metadata url still work.

Changes

  • Bump github.com/inference-gateway/adk to v0.30.0 (go.mod, go.sum)
  • adk.TaskStateCancelled -> adk.TaskStateCanceled at every comparison and construction site: domain/tasks.go state list, key map and display map, background_tasks.go terminal guard, job.go retention matcher, submit_task.go cancel case and the local cancel result
  • Wire tolerance on read: NormalizeTaskState maps TASK_STATE_CANCELED (v1.0.1), TASK_STATE_CANCELLED and the bare cancelled/canceled forms onto adk.TaskStateCanceled, so a v0.29-era agent is still recognized as terminal instead of being polled forever
  • Client param renames from the v0.30.0 interface: TaskQueryParams -> GetTaskRequest, TaskIdParams -> CancelTaskRequest, MessageSendParams -> SendMessageRequest with SendMessageConfiguration. The removed Blocking flag is dropped since ReturnImmediately=false (the default of the empty field) keeps the same wait-for-terminal behavior
  • Flattened v1.0.1 parts: data parts are read via Part.DataMap() (arbitrary JSON value, failure.go) instead of the deleted nested DataPart, file parts via Part.URL instead of Part.File.FileWithURI in the artifact download URL resolution
  • Agent card: the A2A_QueryAgent result now surfaces the preferred endpoint read from card.SupportedInterfaces[0].URL (new a2ainfra.PreferredEndpointURL, falling back to the configured base URL), with a new PreferredEndpointURL helper in the ADK agent-card wrapper
  • Task.ContextID became optional: switch to the adk Task.GetContextID() accessor where the CLI read it as a string (submit_task.go, task_management_view.go) and pass pointers where tasks are rebuilt (job.go, tests)
  • Table test for PreferredEndpointURL covering no card, no interfaces, first interface wins and an empty URL skipped
  • Regenerate tests/mocks/adk/fake_a2aclient.go against the new A2AClient interface via task mocks:generate
  • Add a wire-shape regression test that decodes a v1.0.1 task JSON (flattened data part with the error key and a file part carrying url) through the same decode path the tools use, asserting failure reason and artifact download URL survive

Downstream

  • Docs: filed a [DOCS] ticket in inference-gateway/docs for user-facing A2A v1.0.1 compatibility notes (task state spelling surfaced in results, agent card shape). Affected repos: inference-gateway/docs only, the CLI is a leaf consumer of the ADK.

…re types

- accept the renamed TASK_STATE_CANCELED state, still reading the pre-v1.0.1 TASK_STATE_CANCELLED spelling for in-flight agents - decode the flattened v1.0.1 parts (part.data of any JSON value, part.url for file URLs) and surface the preferred endpoint from card supportedInterfaces - move to the ADK v0.30.0 request types (GetTaskRequest, CancelTaskRequest, SendMessageRequest) and regenerate mocks
Remove the inline comment in the task state key map, since the NormalizeTaskState doc already covers the cancelled alias. Use require.Len in the v1.0.1 wire shape test and add a table test for PreferredEndpointURL.
@edenreich edenreich changed the title fix(a2a): migrate the A2A client to ADK v0.30.0 (A2A v1.0.1 types) refactor(a2a): migrate the A2A client to ADK v0.30.0 (A2A v1.0.1 types) Oct 2, 2026
@edenreich
edenreich merged commit ed387c4 into main Oct 2, 2026
13 checks passed
@edenreich
edenreich deleted the fix/issue-1474 branch October 2, 2026 14:08
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.222.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Oct 2, 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] Migrate the A2A client to ADK v0.30.0 (A2A v1.0.1 types)

1 participant