diff --git a/internal/codex/chat.go b/internal/codex/chat.go index 93af3252..dfccbc08 100644 --- a/internal/codex/chat.go +++ b/internal/codex/chat.go @@ -515,7 +515,7 @@ func (c *Chat) Answer(ctx context.Context, request protocol.ChatAnswerRequest) e action = "accept" } var content any = request.Answers - if action != "accept" { + if action != "accept" || pending.form.Kind == "elicitation-url" { content = nil } result = map[string]any{"action": action, "content": content, "_meta": nil} diff --git a/internal/codex/elicitation.go b/internal/codex/elicitation.go index 57c65d92..163263ec 100644 --- a/internal/codex/elicitation.go +++ b/internal/codex/elicitation.go @@ -28,6 +28,7 @@ func (c *Chat) receiveElicitation(msg rpcMessage) { } form := protocol.ChatForm{ID: "mcp_" + base64.RawURLEncoding.EncodeToString(msg.ID), SessionID: p.ThreadID, Kind: "elicitation", Title: p.Message, Actions: []string{"accept", "decline", "cancel"}} if p.Mode == "url" { + form.Kind = "elicitation-url" form.Fields = []protocol.ChatFormField{{Key: "external", Type: "external", URL: p.URL, Title: "Continue in the external form"}} } else { if p.Schema.Type != "object" || p.Schema.Properties == nil {