feat(helloworld): creating go sample A2A 1.0.3 #626
Conversation
There was a problem hiding this comment.
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.
| // --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 { |
There was a problem hiding this comment.
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).
| 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 { |
94d5422 to
31c9c79
Compare
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