Phase 11, part 4: agents' limits, recent calls and a pause switch
Each agent has calls a minute and things it may ask to send out a day, checked on every tool call and every request to send; every call is recorded (tool, outcome, time) and the agent's page lists the last 50 and what it's waiting on. Pause refuses all its calls at once. Also fixes each agent's MCP server being shared with others that had the same scopes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -398,12 +398,10 @@ func nameSuffix(name string) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// RunAccounts forgets ended sessions, used-up links and old counts of
|
||||
// failed sign-ins, every hour (the server edition).
|
||||
// RunAccounts forgets ended sessions, used-up links, old counts of failed
|
||||
// sign-ins, the audit log past two years and agents' calls past 30 days,
|
||||
// every hour.
|
||||
func (s *Server) RunAccounts(ctx context.Context) {
|
||||
if !s.signsIn() {
|
||||
return
|
||||
}
|
||||
tick := time.NewTicker(time.Hour)
|
||||
defer tick.Stop()
|
||||
for {
|
||||
@@ -419,6 +417,9 @@ func (s *Server) RunAccounts(ctx context.Context) {
|
||||
s.Log.Warn("accounts: pruning counts", "err", err)
|
||||
}
|
||||
s.pruneAudit(now)
|
||||
if err := users.PruneCalls(s.DB, now); err != nil {
|
||||
s.Log.Warn("accounts: pruning agents' calls", "err", err)
|
||||
}
|
||||
})
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
|
||||
Reference in New Issue
Block a user