Skip to content

POST /api/run_sse rejects functionCallEventId field sent by adk-web dev-ui #941

@st699pic

Description

@st699pic

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

  1. Configure an agent with a long-running tool (e.g., one requiring user confirmation or OAuth)
  2. Start the agent with adk web or using full.NewLauncher()
  3. Send a message that triggers the long-running tool
  4. In the dev-ui, respond to the function call confirmation dialog
  5. 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"`
}

Metadata

Metadata

Labels

bugSomething isn't working

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions