Skip to content

feat(helloworld): creating go sample A2A 1.0.3 #626

Open
Iwaniukooo11 wants to merge 2 commits into
a2aproject:mainfrom
Iwaniukooo11:mateusziwaniuk/helloworld-go-sample-update
Open

feat(helloworld): creating go sample A2A 1.0.3 #626
Iwaniukooo11 wants to merge 2 commits into
a2aproject:mainfrom
Iwaniukooo11:mateusziwaniuk/helloworld-go-sample-update

Conversation

@Iwaniukooo11

Copy link
Copy Markdown

This PR introduces a foundational Hello World Agent sample in Go under samples/go/agents/helloworld.

It is designed as a modern, 1-to-1 Go equivalent of samples/python/agents/helloworld, adhering strictly to the A2A v1.0.3 specification

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a Go-based 'Hello World Agent' sample, featuring an HTTP server, an agent executor, and an interactive test client. The review feedback highlights several critical issues: a compilation error in the Containerfile due to missing source files in the build command, a container accessibility issue caused by binding the server to 127.0.0.1 instead of all interfaces, an immediate exit bug in non-interactive environments when reading from os.Stdin, and a potential nil pointer dereference in the agent executor if execCtx.Message is nil.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread samples/go/agents/helloworld/Containerfile
Comment thread samples/go/agents/helloworld/main.go Outdated
// --8<-- [start:AppServer]
go func() {
log.Println("Starting A2A server on http://127.0.0.1:9999...")
if err := http.ListenAndServe("127.0.0.1:9999", mux); err != nil && err != http.ErrServerClosed {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

Binding the HTTP server to 127.0.0.1 inside a container prevents external access (such as port forwarding from the host machine). To allow the containerized server to receive external requests, bind to all interfaces (:9999 or 0.0.0.0:9999).

Suggested change
if err := http.ListenAndServe("127.0.0.1:9999", mux); err != nil && err != http.ErrServerClosed {
if err := http.ListenAndServe(":9999", mux); err != nil && err != http.ErrServerClosed {

Comment thread samples/go/agents/helloworld/test_client.go Outdated
Comment thread samples/go/agents/helloworld/agent_executor.go
@Iwaniukooo11 Iwaniukooo11 force-pushed the mateusziwaniuk/helloworld-go-sample-update branch from 94d5422 to 31c9c79 Compare June 30, 2026 09:38
@Iwaniukooo11 Iwaniukooo11 changed the title add go helloworld sample feat(helloworld): creating go sample A2A 1.0.3 Jun 30, 2026
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.

1 participant