change v1

This commit is contained in:
lky-spec
2026-04-25 16:18:45 +08:00
parent 737f9bca95
commit c244e4cdf1
89 changed files with 17382 additions and 6198 deletions

View File

@@ -8,6 +8,8 @@ import (
"time"
)
const maxPersistentPreferenceLength = 500
// PersistentPreference is a durable user instruction shown in the UI and
// injected into the agent context for future conversations.
type PersistentPreference struct {
@@ -21,6 +23,9 @@ func NewPersistentPreference(text string) (PersistentPreference, error) {
if text == "" {
return PersistentPreference{}, fmt.Errorf("text required")
}
if len([]rune(text)) > maxPersistentPreferenceLength {
return PersistentPreference{}, fmt.Errorf("text too long (max %d characters)", maxPersistentPreferenceLength)
}
now := time.Now().UTC()
return PersistentPreference{