mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-04-30 18:37:28 +08:00
enable runtime compaction tracking and refresh compaction config docs
This commit is contained in:
@@ -833,10 +833,11 @@ func alSessionListForTool(sm *session.SessionManager, limit int) []tools.Session
|
||||
out := make([]tools.SessionInfo, 0, len(items))
|
||||
for _, s := range items {
|
||||
out = append(out, tools.SessionInfo{
|
||||
Key: s.Key,
|
||||
Kind: s.Kind,
|
||||
Summary: s.Summary,
|
||||
UpdatedAt: s.Updated,
|
||||
Key: s.Key,
|
||||
Kind: s.Kind,
|
||||
Summary: s.Summary,
|
||||
CompactionCount: s.CompactionCount,
|
||||
UpdatedAt: s.Updated,
|
||||
})
|
||||
}
|
||||
return out
|
||||
|
||||
@@ -11,10 +11,11 @@ import (
|
||||
)
|
||||
|
||||
type SessionInfo struct {
|
||||
Key string
|
||||
Kind string
|
||||
Summary string
|
||||
UpdatedAt time.Time
|
||||
Key string
|
||||
Kind string
|
||||
Summary string
|
||||
CompactionCount int
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
type SessionsTool struct {
|
||||
@@ -152,7 +153,7 @@ func (t *SessionsTool) Execute(ctx context.Context, args map[string]interface{})
|
||||
var sb strings.Builder
|
||||
sb.WriteString("Sessions:\n")
|
||||
for _, s := range items {
|
||||
sb.WriteString(fmt.Sprintf("- %s kind=%s updated=%s\n", s.Key, s.Kind, s.UpdatedAt.Format(time.RFC3339)))
|
||||
sb.WriteString(fmt.Sprintf("- %s kind=%s compactions=%d updated=%s\n", s.Key, s.Kind, s.CompactionCount, s.UpdatedAt.Format(time.RFC3339)))
|
||||
}
|
||||
return strings.TrimSpace(sb.String()), nil
|
||||
case "history":
|
||||
|
||||
Reference in New Issue
Block a user