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:
@@ -1,8 +1,51 @@
|
||||
{{define "content"}}{{template "settings-start" .}}{{with .Data}}{{$d := .}}{{$a := .Row}}
|
||||
<p><a href="/settings/agents">← Agents</a></p>
|
||||
<h2>{{$a.Name}}{{if $a.BuiltIn}} <span class="pill">built in</span>{{end}}{{if eq $a.Status "disabled"}} <span class="pill">turned off</span>{{end}}</h2>
|
||||
<h2>{{$a.Name}}{{if $a.BuiltIn}} <span class="pill">built in</span>{{end}}{{if eq $a.Status "disabled"}} <span class="pill">turned off</span>{{end}}{{if not $a.Limits.Paused.IsZero}} <span class="pill warn">paused</span>{{end}}</h2>
|
||||
{{with .Problem}}<p class="error" role="alert">{{.}}</p>{{end}}
|
||||
|
||||
<section class="card" id="running">
|
||||
{{if $a.Limits.Paused.IsZero}}
|
||||
<form method="post" action="/settings/agents/{{$a.ID}}/pause" class="row">
|
||||
<button type="submit" class="danger">Pause</button>
|
||||
<span class="help">Stops all its calls at once, whatever key it uses, until it's resumed.</span>
|
||||
</form>
|
||||
{{else}}
|
||||
<form method="post" action="/settings/agents/{{$a.ID}}/resume" class="row">
|
||||
<button type="submit">Resume</button>
|
||||
<span class="help">Paused {{ago $a.Limits.Paused}}{{with by $a.Limits.PausedBy}} {{.}}{{end}}: every call it makes is refused.</span>
|
||||
</form>
|
||||
{{end}}
|
||||
<form method="post" action="/settings/agents/{{$a.ID}}/limits" class="row wrap">
|
||||
<label class="small">Calls a minute <input name="per_minute" type="number" min="1" value="{{$a.Limits.PerMinute}}" class="tiny"></label>
|
||||
<label class="small">Things it asks to send out, a day <input name="out_per_day" type="number" min="1" value="{{$a.Limits.OutPerDay}}" class="tiny"></label>
|
||||
<button type="submit" class="secondary small">Save the limits</button>
|
||||
</form>
|
||||
<p class="help">In the last 24 hours it asked to send out {{.SentDay}} of its {{$a.Limits.OutPerDay}}: posts, emails, mailing-list adds and changes to the sites, approved or not.</p>
|
||||
</section>
|
||||
|
||||
{{if .Waiting}}
|
||||
<section class="card">
|
||||
<h2>Waiting on</h2>
|
||||
<ul>{{range .Waiting}}<li><a href="/approvals#r-{{.ID}}">{{.Summary}}</a> <span class="muted small">asked {{ago .Created}}</span></li>{{end}}</ul>
|
||||
</section>
|
||||
{{end}}
|
||||
|
||||
<section class="card" id="calls">
|
||||
<h2>Recent calls</h2>
|
||||
{{if .Calls}}
|
||||
<table class="list">
|
||||
<thead><tr><th>When</th><th>Tool</th><th>Result</th><th class="num">Took</th></tr></thead>
|
||||
<tbody>{{range .Calls}}<tr>
|
||||
<td title="{{.At.Local.Format "2 Jan 2006 15:04:05"}}">{{ago .At}}</td>
|
||||
<td><code>{{.Tool}}</code></td>
|
||||
<td>{{if eq .Outcome "ok"}}<span class="muted small">{{truncate 100 .Detail}}</span>{{else if eq .Outcome "refused"}}<span class="pill warn">refused</span> <span class="small">{{.Detail}}</span>{{else}}<span class="error-text small">{{truncate 160 .Detail}}</span>{{end}}</td>
|
||||
<td class="num small">{{.Took.Milliseconds}} ms</td>
|
||||
</tr>{{end}}</tbody>
|
||||
</table>
|
||||
<p class="help">The last 50; kept for 30 days.</p>
|
||||
{{else}}<p class="muted">No calls yet.</p>{{end}}
|
||||
</section>
|
||||
|
||||
<form class="card" method="post" action="/settings/agents/{{$a.ID}}/save">
|
||||
<label>Name <input name="name" value="{{$a.Name}}" required></label>
|
||||
<label>What it's for <textarea name="description" rows="2">{{$a.Description}}</textarea></label>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<thead><tr><th>Agent</th><th>May</th><th>Keys</th><th>Last used</th></tr></thead>
|
||||
<tbody>
|
||||
{{range .Rows}}<tr>
|
||||
<td><a href="/settings/agents/{{.ID}}">{{.Name}}</a>{{if .BuiltIn}} <span class="pill">built in</span>{{end}}{{if eq .Status "disabled"}} <span class="pill">turned off</span>{{end}}{{with .Description}}<br><span class="muted small">{{truncate 120 .}}</span>{{end}}</td>
|
||||
<td><a href="/settings/agents/{{.ID}}">{{.Name}}</a>{{if .BuiltIn}} <span class="pill">built in</span>{{end}}{{if eq .Status "disabled"}} <span class="pill">turned off</span>{{end}}{{if not .Limits.Paused.IsZero}} <span class="pill warn">paused</span>{{end}}{{with .Description}}<br><span class="muted small">{{truncate 120 .}}</span>{{end}}</td>
|
||||
<td>{{.Access}}</td>
|
||||
<td>{{if .Working}}{{.Working}} working{{else}}<span class="warn-text">none working</span>{{end}}</td>
|
||||
<td>{{with .Last}}{{ago .Used}}{{with .UsedFrom}} <span class="muted small">from {{.}}</span>{{end}}{{else}}<span class="muted">never</span>{{end}}</td>
|
||||
|
||||
Reference in New Issue
Block a user