Let pick-one answers carry notes from the Other box
This commit is contained in:
@@ -494,12 +494,12 @@ func deliveryMessage(pending []store.Pending) string {
|
||||
for _, o := range *r.Options {
|
||||
fmt.Fprintf(b, "- %s\n", o)
|
||||
}
|
||||
if r.Text != nil && strings.TrimSpace(*r.Text) != "" {
|
||||
fmt.Fprintf(b, "%s added: %s\n", r.User, *r.Text)
|
||||
}
|
||||
} else {
|
||||
fmt.Fprintf(b, "%s chose: %s\n", r.User, (*r.Options)[0])
|
||||
}
|
||||
if r.Text != nil && strings.TrimSpace(*r.Text) != "" {
|
||||
fmt.Fprintf(b, "%s added: %s\n", r.User, *r.Text)
|
||||
}
|
||||
case api.Other:
|
||||
text := ""
|
||||
if r.Text != nil {
|
||||
|
||||
@@ -110,7 +110,7 @@ func (m *Manager) leadTools(l *live) []mcp.Tool {
|
||||
|
||||
tool("answer_question",
|
||||
"Answer an open question on the human's behalf. Only when the answer is clear or the human told you it. "+
|
||||
"type option: options holds the chosen choices' exact text (one for pick-one; pick-any may add text). "+
|
||||
"type option: options holds the chosen choices' exact text (one for pick-one), and text may add notes."+
|
||||
"type other: free text.",
|
||||
`{"type": "object", "properties": {
|
||||
"item_id": {"type": "string"},
|
||||
|
||||
@@ -130,9 +130,6 @@ func CheckResponse(item api.InboxItem, c api.InboxResponseCreate) (api.InboxStat
|
||||
}
|
||||
seen[o] = true
|
||||
}
|
||||
if (text != "" || images) && item.Payload["multiple"] != true {
|
||||
return bad("a pick-one option takes no text or images; use other")
|
||||
}
|
||||
return api.Answered, nil
|
||||
|
||||
case api.Other:
|
||||
|
||||
Reference in New Issue
Block a user