Bug Description
When using the ADK dev-ui (adk-web) to respond to a long-running function call (e.g., OAuth authorization or human-in-the-loop confirmation), the request to POST /api/run_sse fails with:
failed to decode request body: failed to decode request: json: unknown field "functionCallEventId"
Root Cause
The dev-ui frontend (bundled in cmd/launcher/web/webui/distr/main-*.js) sends functionCallEventId in the request body when resuming a long-running function call:
// From dev-ui bundle (minified)
let e = {
appName: this.appName,
userId: this.userId,
sessionId: this.sessionId,
newMessage: { role: "user", parts: [{ functionResponse: {...} }] },
functionCallEventId: this.functionCall.functionCallEventId // ← this field
};
this.agentService.runSse(e).subscribe(...)
However, the Go backend RunAgentRequest struct (server/adkrest/internal/models/runtime.go:23) does not define this field:
type RunAgentRequest struct {
AppName string `json:"appName"`
UserId string `json:"userId"`
SessionId string `json:"sessionId"`
NewMessage genai.Content `json:"newMessage"`
Streaming bool `json:"streaming,omitempty"`
StateDelta *map[string]any `json:"stateDelta,omitempty"`
}
And the decoder at server/adkrest/controllers/runtime.go:240 uses DisallowUnknownFields():
func decodeRequestBody(req *http.Request) (models.RunAgentRequest, error) {
var runAgentRequest models.RunAgentRequest
d := json.NewDecoder(req.Body)
d.DisallowUnknownFields() // ← rejects functionCallEventId
...
}
Expected Behavior
The /run_sse endpoint should accept the functionCallEventId field (either by adding it to the struct or by removing strict unknown-field validation), allowing the dev-ui long-running function call flow to work end-to-end.
Steps to Reproduce
- Configure an agent with a long-running tool (e.g., one requiring user confirmation or OAuth)
- Start the agent with
adk web or using full.NewLauncher()
- Send a message that triggers the long-running tool
- In the dev-ui, respond to the function call confirmation dialog
- Observe the 400 error:
json: unknown field "functionCallEventId"
Environment
- ADK Go version: v1.4.0 (latest)
- Dev-UI: bundled version in
cmd/launcher/web/webui/distr/
Suggested Fix
Add FunctionCallEventId to the RunAgentRequest struct:
type RunAgentRequest struct {
AppName string `json:"appName"`
UserId string `json:"userId"`
SessionId string `json:"sessionId"`
NewMessage genai.Content `json:"newMessage"`
Streaming bool `json:"streaming,omitempty"`
StateDelta *map[string]any `json:"stateDelta,omitempty"`
FunctionCallEventId string `json:"functionCallEventId,omitempty"`
}
Bug Description
When using the ADK dev-ui (adk-web) to respond to a long-running function call (e.g., OAuth authorization or human-in-the-loop confirmation), the request to
POST /api/run_ssefails with:Root Cause
The dev-ui frontend (bundled in
cmd/launcher/web/webui/distr/main-*.js) sendsfunctionCallEventIdin the request body when resuming a long-running function call:However, the Go backend
RunAgentRequeststruct (server/adkrest/internal/models/runtime.go:23) does not define this field:And the decoder at
server/adkrest/controllers/runtime.go:240usesDisallowUnknownFields():Expected Behavior
The
/run_sseendpoint should accept thefunctionCallEventIdfield (either by adding it to the struct or by removing strict unknown-field validation), allowing the dev-ui long-running function call flow to work end-to-end.Steps to Reproduce
adk webor usingfull.NewLauncher()json: unknown field "functionCallEventId"Environment
cmd/launcher/web/webui/distr/Suggested Fix
Add
FunctionCallEventIdto theRunAgentRequeststruct: