an act with nothing on the other end says so (V-556)
askClarify parked "Что сделать?" whatever was on the other end. With an empty allowlist that question has no answer: she asks, fails, asks again and gives up, three turns spent on a request she could have declined in the first one. Empty allowlist now names the gap and parks nothing. A non-empty one still asks, and names what she can run, capped at six, so the question is answerable.
This commit is contained in:
@@ -156,6 +156,20 @@ func (h *reactiveHandler) askClarify(ctx context.Context, dec router.Decision) (
|
||||
if !ok {
|
||||
return "", false
|
||||
}
|
||||
// An act is the one gap that may have nothing on the other end. Ask only
|
||||
// when she has something to run, and say what it is (Vikunja #556).
|
||||
if slot == dialogue.SlotFn {
|
||||
var allow []string
|
||||
if h.matcher != nil {
|
||||
allow = h.matcher.Allowlist()
|
||||
}
|
||||
reply, ask := fnClarify(allow, 1)
|
||||
if !ask {
|
||||
log.Printf("voice: clarify — act with %d allowlisted fns; naming the gap instead of asking", len(allow))
|
||||
return reply, reply != ""
|
||||
}
|
||||
question = reply
|
||||
}
|
||||
h.clarifyStore.Put(dialogueIDOf(ctx), &dialogue.PendingQuestion{
|
||||
Intent: dialogue.Intent(dec.Intent),
|
||||
Slots: toDialogueSlots(dec.Slots),
|
||||
|
||||
Reference in New Issue
Block a user