From 1f383de80ee64f3b6cb73c6c1c639da170aa19d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Sat, 3 Jan 2026 22:01:33 +0800 Subject: [PATCH] chore: remove useless param --- agent.go | 7 +++---- prompt_test.go | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/agent.go b/agent.go index 819b7aa..8ce6ef8 100644 --- a/agent.go +++ b/agent.go @@ -46,7 +46,6 @@ type Agent struct { perm *Perm imgpcache *ttl.Cache[uint64, string] mem MemoryStorage - manualaddreq bool manualaddmem bool hasimageapi bool } @@ -60,13 +59,13 @@ type Agent struct { func NewAgent( id int64, batchcap, itemscap int, imgpcachettl time.Duration, nickname, sex, characteristics, defaultprompt string, mem MemoryStorage, - manualaddreq, manualaddmem bool, + manualaddmem bool, ) (ag Agent) { ag = Agent{ id: id, nickname: nickname, sex: sex, chars: characteristics, imgpcache: ttl.NewCache[uint64, string](imgpcachettl), log: chat.NewLog[fmt.Stringer](batchcap, itemscap, "\n", defaultprompt), - mem: mem, manualaddreq: manualaddreq, manualaddmem: manualaddmem, + mem: mem, manualaddmem: manualaddmem, } _ = ag.LoadPermTable() return @@ -254,7 +253,7 @@ func (ag *Agent) GetAction(api deepinfra.API, p model.Protocol, grp int64, role case !ag.perm.allow(role, r.Action): err = errors.Wrap(ErrPermissionDenied, r.Action) return - case !ag.manualaddreq: + default: ag.AddRequest(grp, &r) if !ag.manualaddmem && r.Action == SVM { txt, err := extractMemory(&r) diff --git a/prompt_test.go b/prompt_test.go index b994fc6..8b30a8f 100644 --- a/prompt_test.go +++ b/prompt_test.go @@ -511,7 +511,7 @@ func (fakemem) Load(grp int64) []string { func TestAgent_system(t *testing.T) { ag := NewAgent( 12345, 10, 10, time.Minute, "testname", "testsex", "testchar", - "testd", &fakemem{}, false, false, + "testd", &fakemem{}, false, ) p, err := ag.system(PermRoleAdmin, 123) if err != nil {