From e374e8ef03182e40a1ef5fbbc7c96bd7539323ec Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Tue, 20 Oct 2026 17:43:14 +0100 Subject: [PATCH] fix(codex): return no content for URL elicitation confirmation --- internal/codex/chat.go | 2 +- internal/codex/elicitation.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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 {