feat: NoMemory/Cleaner memory system + doc update

- _sdk_local/ removed (moved to standalone sdk repo)
- internal/agent/core: NoMemory/Cleaner data-flow breakpoints
- internal/memory: clean_text, document store refactor
- internal/plugin/registry.go: plugin API alignment
- docs: PLUGIN_DEV.md, ARCHITECTURE.md NoMemory/Cleaner docs
- plan.md, review.md: status update
This commit is contained in:
JianFeeeee
2026-07-25 11:17:31 +08:00
parent a51124aa92
commit b31db0f88e
36 changed files with 639 additions and 2488 deletions

View File

@ -5,10 +5,6 @@ import (
)
func TestCleanTextTrim(t *testing.T) {
prev := globalTextCleaner
globalTextCleaner = nil
defer func() { globalTextCleaner = prev }()
tests := []struct {
input string
expected string
@ -29,55 +25,3 @@ func TestCleanTextTrim(t *testing.T) {
}
}
}
func TestCleanTextWithRegisteredCleaner(t *testing.T) {
prev := globalTextCleaner
globalTextCleaner = func(text string) string {
return "prefix_" + text
}
defer func() { globalTextCleaner = prev }()
got := CleanText(" hello ")
if got != "prefix_ hello" {
t.Errorf("CleanText with cleaner = %q, want %q", got, "prefix_ hello")
}
}
func TestCleanTextCleanerChain(t *testing.T) {
prev := globalTextCleaner
globalTextCleaner = func(text string) string {
text = text + "_step1"
text = text + "_step2"
return text
}
defer func() { globalTextCleaner = prev }()
got := CleanText("test")
if got != "test_step1_step2" {
t.Errorf("CleanText chain = %q, want %q", got, "test_step1_step2")
}
}
func TestSetTextCleanerReplace(t *testing.T) {
prev := globalTextCleaner
globalTextCleaner = func(text string) string { return "old_" + text }
SetTextCleaner(func(text string) string { return "new_" + text })
defer func() { globalTextCleaner = prev }()
got := CleanText("x")
if got != "new_x" {
t.Errorf("after SetTextCleaner = %q, want %q", got, "new_x")
}
}
func TestCleanTextEmptyAfterCleaner(t *testing.T) {
prev := globalTextCleaner
globalTextCleaner = func(text string) string { return "" }
defer func() { globalTextCleaner = prev }()
got := CleanText("something")
if got != "" {
t.Errorf("expected empty, got %q", got)
}
}