mirror of
https://github.com/RuoJi6/ARTEX.git
synced 2026-10-28 09:13:49 +08:00
抽屉优化
This commit is contained in:
1 parent
7234874797
commit
d968727460
14 files changed
+669
-154
No files matched your search
@@ -734,6 +734,16 @@ func (s *Server) pgListTools(w http.ResponseWriter, r *http.Request) {
|
||||
if ts == nil {
|
||||
ts = []*db.Tool{}
|
||||
}
|
||||
// Usage is best-effort decoration. Runtime tool resolution keeps using the plain
|
||||
// catalog query, so agent assembly never pays for this aggregate.
|
||||
counts, countErr := pg.ToolUsageCounts()
|
||||
if countErr != nil {
|
||||
log.Printf("[tools] 读取调用统计失败: %v", countErr)
|
||||
} else {
|
||||
for _, tool := range ts {
|
||||
tool.Calls = counts[tool.Key]
|
||||
}
|
||||
}
|
||||
writeJSON(w, 200, map[string]any{"tools": ts})
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user