fix(codex): return no content for URL elicitation confirmation
This commit is contained in:
@@ -515,7 +515,7 @@ func (c *Chat) Answer(ctx context.Context, request protocol.ChatAnswerRequest) e
|
|||||||
action = "accept"
|
action = "accept"
|
||||||
}
|
}
|
||||||
var content any = request.Answers
|
var content any = request.Answers
|
||||||
if action != "accept" {
|
if action != "accept" || pending.form.Kind == "elicitation-url" {
|
||||||
content = nil
|
content = nil
|
||||||
}
|
}
|
||||||
result = map[string]any{"action": action, "content": content, "_meta": nil}
|
result = map[string]any{"action": action, "content": content, "_meta": nil}
|
||||||
|
|||||||
@@ -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"}}
|
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" {
|
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"}}
|
form.Fields = []protocol.ChatFormField{{Key: "external", Type: "external", URL: p.URL, Title: "Continue in the external form"}}
|
||||||
} else {
|
} else {
|
||||||
if p.Schema.Type != "object" || p.Schema.Properties == nil {
|
if p.Schema.Type != "object" || p.Schema.Properties == nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user