adk-go icon indicating copy to clipboard operation
adk-go copied to clipboard

adkrest server controller panic when llm generate returns error

Open byebyebruce opened this issue 1 month ago • 2 comments

Describe the bug adkrest server controller panic when llm generate returns error

To Reproduce Is continue correct? or maybe return?

// server/adkrest/controllers/runtime.go

	resp := r.Run(req.Context(), runAgentRequest.UserId, runAgentRequest.SessionId, &runAgentRequest.NewMessage, *rCfg)

	rw.WriteHeader(http.StatusOK)
	for event, err := range resp {
		if err != nil {
			_, err := fmt.Fprintf(rw, "Error while running agent: %v\n", err)
			if err != nil {
				return newStatusError(fmt.Errorf("write response: %w", err), http.StatusInternalServerError)
			}
			flusher.Flush()
			continue
		}
		err := flashEvent(flusher, rw, *event)
		if err != nil {
			return err
		}
	}
	return nil
}
Image

Expected behavior No panic

Screenshots

Image

Desktop (please complete the following information):

  • OS: [macOS]
  • Go version: go version go1.24.9 darwin/arm64
  • ADK version: v0.2.0

Model Information:

  • openai gpt-5.1(adapted model )

byebyebruce avatar Dec 03 '25 03:12 byebyebruce

@team could you please assign this issue to me? I love to contribute.

maishivamhoo123 avatar Dec 11 '25 14:12 maishivamhoo123

@team could you please assign this issue to me? I love to contribute.

Assigned, thanks for help!

dpasiukevich avatar Dec 12 '25 11:12 dpasiukevich