Skip to content

Commit c4c0a7e

Browse files
committed
fix(chat): agent at all check
1 parent 494cb17 commit c4c0a7e

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

chat/agent.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,24 +140,31 @@ func CallAgent(ag *goba.Agent, issudo bool, iter int, api deepinfra.API, p model
140140
continue
141141
}
142142
msgs := message.ParseMessageFromArray(gjson.Parse(binary.BytesToString(msgb)))
143+
isvalid := true
143144
for _, m := range msgs {
144145
if m.Type == "at" {
145146
qqs, ok := m.Data["qq"]
146147
if !ok {
147148
logrus.Warnln("[chat] invalid at message without qq")
148-
continue
149+
isvalid = false
150+
break
149151
}
150152
qq, err := strconv.ParseInt(qqs, 10, 64)
151153
if err != nil {
152154
logrus.Warnln("[chat] invalid at qq", qqs)
153-
continue
155+
isvalid = false
156+
break
154157
}
155158
if qq <= 0 {
156159
logrus.Warnln("[chat] invalid at qq num", qq)
157-
continue
160+
isvalid = false
161+
break
158162
}
159163
}
160164
}
165+
if !isvalid {
166+
continue
167+
}
161168
}
162169
}
163170
checkedreqs = append(checkedreqs, req)

0 commit comments

Comments
 (0)