Go: fix context (#18118)

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
Jin Hai
2026-08-11 19:19:29 +08:00
committed by GitHub
parent 8bd5768ebc
commit c75edbfbe8
36 changed files with 492 additions and 352 deletions

View File

@@ -28,7 +28,8 @@ import (
func TestStubMemorySaver_DefaultReturnsError(t *testing.T) {
SetMemorySaver(nil)
saver := GetMemorySaver()
err := saver.Save(context.Background(), MemorySaveRequest{
ctx := t.Context()
err := saver.Save(ctx, MemorySaveRequest{
MemoryIDs: []string{"m1"},
AgentID: "a1",
})
@@ -48,7 +49,8 @@ func TestSetMemorySaver_Roundtrip(t *testing.T) {
if got != custom {
t.Fatalf("saver not registered")
}
if err := got.Save(context.Background(), MemorySaveRequest{
ctx := t.Context()
if err := got.Save(ctx, MemorySaveRequest{
MemoryIDs: []string{"m1"},
AgentResponse: "hi",
}); err != nil {