agentproto steward
agentproto steward [--apply] [--idle <min>] [--min-confidence <x>]
[--judge <auto|jev|agent>] [--ask-sessions] [--wait] [--json]Convenience shortcut over agentproto workflow run-file for the built-in
session-steward app's
workflow: wrap up idle agent sessions. Needs a running daemon
(agentproto serve) — the workflow reads live sessions and its agent judge
spawns real (one-shot) sessions. A dry run unless --apply.
One run:
- Plans with
session_wrapup_plan: every idle agent session isclose,stuck,judgeorkeep. - With
--apply: closesclose-class sessions asdoneandstuck-class ones asabandoned— resumable, with a recorded outcome. - Collects compact, read-only evidence (
session_evidence) for up to 15judge-class sessions, most RAM first. - Judges each one: with Jev (TypeSafe System One — a calibrated choice
with probabilities) when
jev.apiKeyfrom~/.agentproto/config.jsonor theJEV_API_KEYenv var resolves, else a one-shot agent judge (sonnet). A Jev failure falls back to the agent judge for that session; a malformed or failed judgement isactiveand never acted on. - With
--ask-sessions: asks low-confidence idle sessions directly whether they're done (one prompt each, ~3 min bounded wait). - With
--apply: confident (≥--min-confidence)done/abandonedverdicts close the session;blocked/needs-inputonly flag it. - Reports a markdown table plus RAM freed / still held.
keep-class sessions and the calling session (AGENTPROTO_SESSION_ID) are
never touched, and session_wrapup_apply re-checks every id right before
acting.
| Flag | Default | Description |
|---|---|---|
--apply | false | Close / flag sessions. Without it: plan + verdicts only, nothing is touched. |
--idle <min> | 30 | Idle threshold in minutes. |
--min-confidence <x> | 0.8 | Judge confidence (0..1) needed to act on a verdict. |
--judge <backend> | auto | auto (Jev when jev.apiKey config or JEV_API_KEY env resolves, else the agent judge), jev, or agent. |
--ask-sessions | false | Ask low-confidence sessions directly — spends a turn in their conversation. |
--wait | false | Block until the run ends, then print its markdown report. Exit 0 when done, 1 when it failed or was cancelled. |
--json | false | Print the raw workflow_run_file reply (with --wait: the finished run record). |
This starts the run and returns immediately — poll it with:
agentproto workflow status <runId>Or pass --wait to block until it finishes and print the report inline.
Examples
# Dry run: plan + verdicts, print the report
agentproto steward --wait
# Close / flag confident verdicts
agentproto steward --apply --wait
# Stricter: only sessions idle an hour, agent judge, 0.9 confidence
agentproto steward --apply --idle 60 --judge agent --min-confidence 0.9Scheduling it
packages/apps/session-steward/routines/session-steward-hourly is an AIP-41
ROUTINE.md template — hourly, apply: true, askSessions: false — shipped
enabled: false, so nothing starts closing sessions on install. Its own doc
lists the enabling steps.