refactor: replace history_split with current_input_file configuration

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
CJACK
2026-04-27 23:36:56 +08:00
parent 1e9170e385
commit 28bb85ad63
33 changed files with 184 additions and 517 deletions

View File

@@ -17,7 +17,7 @@ func (h *Handler) updateSettings(w http.ResponseWriter, r *http.Request) {
return
}
adminCfg, runtimeCfg, compatCfg, responsesCfg, embeddingsCfg, autoDeleteCfg, historySplitCfg, currentInputCfg, thinkingInjCfg, aliasMap, err := parseSettingsUpdateRequest(req)
adminCfg, runtimeCfg, compatCfg, responsesCfg, embeddingsCfg, autoDeleteCfg, currentInputCfg, thinkingInjCfg, aliasMap, err := parseSettingsUpdateRequest(req)
if err != nil {
writeJSON(w, http.StatusBadRequest, map[string]any{"detail": err.Error()})
return
@@ -71,26 +71,10 @@ func (h *Handler) updateSettings(w http.ResponseWriter, r *http.Request) {
c.AutoDelete.Mode = autoDeleteCfg.Mode
c.AutoDelete.Sessions = autoDeleteCfg.Sessions
}
if historySplitCfg != nil {
if historySplitCfg.Enabled != nil {
c.HistorySplit.Enabled = historySplitCfg.Enabled
if *historySplitCfg.Enabled {
disabled := false
c.CurrentInputFile.Enabled = &disabled
}
}
if historySplitCfg.TriggerAfterTurns != nil {
c.HistorySplit.TriggerAfterTurns = historySplitCfg.TriggerAfterTurns
}
}
if currentInputCfg != nil {
if currentInputEnabledSet {
c.CurrentInputFile.Enabled = currentInputCfg.Enabled
}
if currentInputEnabledSet && currentInputCfg.Enabled != nil && *currentInputCfg.Enabled {
disabled := false
c.HistorySplit.Enabled = &disabled
}
if currentInputMinCharsSet {
c.CurrentInputFile.MinChars = currentInputCfg.MinChars
}