From bfc7f1525417d3ec87ccf71577bbfdb930b5e031 Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Sun, 17 May 2026 11:03:54 +0200 Subject: [PATCH] tier: built-in default cold table for known read-only tools --- pkg/tools/execute/tier.go | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) 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"