We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dfdf779 commit 8371b81Copy full SHA for 8371b81
chat/agent.go
@@ -211,13 +211,15 @@ func logev(ctx *zero.Ctx) {
211
}
212
vevent.HookCtxCaller(ctx, vevent.NewAPICallerReturnHook(
213
ctx, func(req zero.APIRequest, rsp zero.APIResponse, err error) {
214
- if countParamsLength(req.Params) > 256 { // skip too long req&resp
215
- return
216
- }
217
gid := ctx.Event.GroupID
218
if gid == 0 {
219
gid = -ctx.Event.UserID
220
+ plen := countParamsLength(req.Params)
+ if plen > 1024 { // skip too long req&resp
+ logrus.Warnln("[chat] agent", gid, "skip too long requ:", &req)
221
+ return
222
+ }
223
ag := AgentOf(ctx.Event.SelfID, "aichat")
224
logrus.Infoln("[chat] agent", gid, "add requ:", &req)
225
ag.AddRequest(gid, &req)
0 commit comments