diff --git a/pkg/tools/execute/tier.go b/pkg/tools/execute/tier.go index f85e308..a12ced2 100644 --- a/pkg/tools/execute/tier.go +++ b/pkg/tools/execute/tier.go @@ -2,10 +2,24 @@ package execute import "strings" -// ResultTier implements tools.TierClassifier. It reads the tool script's -// "ollie:tier" annotation to determine result retention. Returns "hot" if -// no annotation is found. +// defaultColdTools are tools whose results are consumed immediately and don't +// need to persist verbatim in the message history. +var defaultColdTools = map[string]string{ + "file_read": "cold", + "memory_recall": "cold", + "web_fetch": "cold", + "web_search": "cold", + "lsp_definition": "cold", + "lsp_references": "cold", + "lsp_hover": "cold", +} + +// ResultTier implements tools.TierClassifier. Checks the built-in table first, +// then falls back to the script's "ollie:tier" annotation. func (e *Server) ResultTier(name string) string { + if tier, ok := defaultColdTools[name]; ok { + return tier + } code, err := ReadTool(name) if err != nil { return "hot"