Why: Allow consumers to download an immutable module revision without nested source checkouts or local path replacements. Evidence: SELF package tests and the prior canonical-path rejection are recorded in the Dev dependency-workspace task card; remote consumption is replayed against the committed candidate. Impact: Change the module identity and its Go imports while preserving API behavior. Existing historical submodule revisions remain buildable. Refs: Versioned dependencies U1/U3; feature/dependency-workspace
26 lines
949 B
Go
26 lines
949 B
Go
package ctxasm
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
|
|
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
|
|
)
|
|
|
|
func TestSummarizeBeyondInjectsExtract(t *testing.T) {
|
|
var history []core.Message
|
|
for i := 0; i < 5; i++ {
|
|
history = append(history, core.Message{ID: core.ID("m"), Role: core.RoleUser, Parts: []core.Part{{Type: core.PartText, Text: "早期事实"}}})
|
|
}
|
|
current := core.Message{ID: "cur", Role: core.RoleUser, Parts: []core.Part{{Type: core.PartText, Text: "现在"}}}
|
|
prof := core.AgentProfile{Context: core.ContextPolicy{MaxHistoryMessages: 2, SummarizeBeyond: true}}
|
|
msgs, rep := AssembleInput(prof, core.EffectiveSettings{}, history, current, nil, nil, nil, nil, nil, nil, AssembleOptions{})
|
|
joined := ""
|
|
for _, m := range msgs {
|
|
joined += m.Content
|
|
}
|
|
if !strings.Contains(joined, "更早对话摘要") || !strings.Contains(joined, "早期事实") {
|
|
t.Fatalf("summary missing: %s items=%v", joined, rep.Items)
|
|
}
|
|
}
|