tier: built-in default cold table for known read-only tools
This commit is contained in:
parent
1cf171adae
commit
bfc7f15254
|
|
@ -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"
|
||||
|
|
|
|||
Reference in New Issue