Why: Downstream products must extend the base through a public package and host API instead of editing internal code. Evidence: go test ./... passed, including plugin v2 assets, sidecar startup, migration v13, pending confirms, HITL timeout, hash embedder, command pairs, and the extension surface snapshot. Impact: apiVersion 2.0-experimental rejects empty network allowlists for declarative HTTP. Hash embeddings stay opt-in via models.embedding.provider=hash. Plugin secrets resolve per owner at execution time. Refs: docs/proposals/2026-10-01-plugin-contract-v2.md Co-authored-by: Cursor <cursoragent@cursor.com>
26 lines
892 B
Go
26 lines
892 B
Go
package ctxasm
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
|
|
core "agent-system-core"
|
|
)
|
|
|
|
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)
|
|
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)
|
|
}
|
|
}
|