refactor: remove max_context_load_time and max_context_tokens from bot settings

These two fields controlled history context window (time-based) and token-based
trimming. They are no longer needed — the resolver now always uses the hardcoded
24-hour default and skips token-based history trimming.
This commit is contained in:
Acbox
2026-03-29 00:00:10 +08:00
parent 90ac222bc9
commit 0730ff2945
25 changed files with 176 additions and 388 deletions
+16 -18
View File
@@ -93,7 +93,7 @@ func (*fakeRows) Conn() *pgx.Conn { return nil }
func makeBotRow(botID, ownerUserID pgtype.UUID) *fakeRow {
return &fakeRow{
scanFunc: func(dest ...any) error {
if len(dest) < 24 {
if len(dest) < 22 {
return pgx.ErrNoRows
}
*dest[0].(*pgtype.UUID) = botID
@@ -103,23 +103,21 @@ func makeBotRow(botID, ownerUserID pgtype.UUID) *fakeRow {
*dest[4].(*pgtype.Text) = pgtype.Text{}
*dest[5].(*bool) = true
*dest[6].(*string) = bots.BotStatusReady
*dest[7].(*int32) = 30
*dest[8].(*int32) = 0
*dest[9].(*string) = ""
*dest[10].(*bool) = false
*dest[11].(*string) = "medium"
*dest[12].(*pgtype.UUID) = pgtype.UUID{}
*dest[13].(*pgtype.UUID) = pgtype.UUID{}
*dest[14].(*pgtype.UUID) = pgtype.UUID{}
*dest[15].(*bool) = false
*dest[16].(*int32) = 30
*dest[17].(*string) = ""
*dest[18].(*bool) = false // CompactionEnabled
*dest[19].(*int32) = 100000 // CompactionThreshold
*dest[20].(*pgtype.UUID) = pgtype.UUID{} // CompactionModelID
*dest[21].(*[]byte) = []byte(`{}`)
*dest[22].(*pgtype.Timestamptz) = pgtype.Timestamptz{}
*dest[23].(*pgtype.Timestamptz) = pgtype.Timestamptz{}
*dest[7].(*string) = "" // Language
*dest[8].(*bool) = false // ReasoningEnabled
*dest[9].(*string) = "medium" // ReasoningEffort
*dest[10].(*pgtype.UUID) = pgtype.UUID{} // ChatModelID
*dest[11].(*pgtype.UUID) = pgtype.UUID{} // SearchProviderID
*dest[12].(*pgtype.UUID) = pgtype.UUID{} // MemoryProviderID
*dest[13].(*bool) = false // HeartbeatEnabled
*dest[14].(*int32) = 30 // HeartbeatInterval
*dest[15].(*string) = "" // HeartbeatPrompt
*dest[16].(*bool) = false // CompactionEnabled
*dest[17].(*int32) = 100000 // CompactionThreshold
*dest[18].(*pgtype.UUID) = pgtype.UUID{} // CompactionModelID
*dest[19].(*[]byte) = []byte(`{}`)
*dest[20].(*pgtype.Timestamptz) = pgtype.Timestamptz{}
*dest[21].(*pgtype.Timestamptz) = pgtype.Timestamptz{}
return nil
},
}