API interne : critères changés par un outil, fichiers seuls au reset

/internal/v1/tool/exec rend la liste des critères après un appel de
l'outil criteria qui l'a changée (add, set, clear) : critNotify la pousse
au journal du Go, une conversation tenue par la façade la reçoit ici.
/internal/v1/conv/dropped accepte files_only : Reset vide la discussion
et ses fichiers, sans la supprimer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016tcGfJWefW5kUGoC2wL8cv
This commit is contained in:
Claude committed 2026-10-15 11:11:22 +00:00
1 parent b5649eb506
commit e96ffe319c
3 files changed
+49 -5

No files matched your search

+23 -4
View File
@@ -58,10 +58,29 @@ func handleInternalToolExec(w http.ResponseWriter, r *http.Request) {
sendJSON(w, http.StatusOK, struct {
Label string `json:"label"`
toolExecResult
Image string `json:"image,omitempty"`
Shot string `json:"shot,omitempty"`
Relay *Message `json:"relay,omitempty"`
}{label, res, image, shot, relay})
Image string `json:"image,omitempty"`
Shot string `json:"shot,omitempty"`
Relay *Message `json:"relay,omitempty"`
Criteria []Criterion `json:"criteria,omitempty"`
}{label, res, image, shot, relay, criteriaAfter(in.Name, in.Args, res)})
}
// criteriaAfter : la liste des critères après un appel qui l'a changée
// (critNotify la pousse au journal du Go ; une conversation tenue par la
// façade la reçoit ici). nil sinon.
func criteriaAfter(name string, args map[string]any, res toolExecResult) []Criterion {
if name != "criteria" || strings.HasPrefix(res.Result, "[erreur]") {
return nil
}
switch a, _ := args["action"].(string); a {
case "add", "set", "clear":
list := critList(convActiveID())
if list == nil {
list = []Criterion{}
}
return list
}
return nil
}
// toolStepExtras : ce que runChatLoop tire d'un résultat d'outil après