Wrap up idle agentproto agent sessions — classify them, close the safe ones, judge the ambiguous ones. Use when the user says "clean up idle sessions", "run the steward", "close finished sessions", or asks which sessions are still needed. Dry run by default; closing (--apply) mutates daemon state.
Install
npx skillscat add agentproto/ts/session-steward Install via the SkillsCat registry.
Session Steward
The steward wraps up idle agent sessions. It classifies them withsession_wrapup_plan, closes the rule-certain ones, and sends the ambiguous
ones through a cheap judge (Jev classifier, fallback: a one-shot LLM agent).
Dry run by default — nothing is closed unless --apply.
Run it
Prefer the CLI (it installs/updates the app and runs the workflow):
agentproto steward --waitVariants:
agentproto steward --wait # dry run: plan + verdicts + report
agentproto steward --apply --wait # close/flag confident verdicts
agentproto steward --apply --wait --idle 60 # stricter idle threshold (minutes)
agentproto steward --apply --wait --min-confidence 0.9
agentproto steward --apply --wait --judge agent # force the LLM judge lane
agentproto steward --ask-sessions --wait # ask low-confidence sessions directly--wait blocks until the report is ready (a run takes ~1-3 min depending on
candidate count). Without it, poll with workflow_status on the returned
runId.
Read the report
The final step output is a markdown table: class (close/stuck/judge),
session label + id, idle time, RAM, verdict, confidence, reason, action.
Key reading rules:
closerows are safe to auto-close;judgerows are what the judge saw.- Verdicts:
done|abandoned|blocked|needs-input|active. Only confidentdone/abandonedclose (sessions stay resumable; transcripts preserved).blocked/needs-inputonly get flagged, never closed. - A judge error never closes anything. If many verdicts come back
activeconfidence 0, the judge lane failed (check Jev key configjev.apiKeyin ~/.agentproto/config.json, envJEV_API_KEYfallback). - RAM freed / still held is summarized at the end.
Session snapshot (browsing aid)
scripts/sessions-snapshot.sh dumps the 50 most recently active daemon agent
sessions to a markdown table — id, label, adapter, model, status, idle time,
parent, steward flag, outcome, last summary, plus the last steward run. It
reads the daemon's HTTP API (GET /sessions, GET /workflows) and writes a
generated file; it never mutates daemon state, so it is safe to run any time.
./scripts/sessions-snapshot.sh [out.md] [count]
# defaults: data/sessions-latest.md, 50The output lands under data/ (git-ignored — it is a regenerated snapshot,
never committed). Use it to eyeball what the steward is about to classify
before running with --apply.
Rules
- NEVER run with
--applywithout explicit user go-ahead. Dry run first,
show the report, then apply. - Never judge the calling session — the CLI already excludes it.
- If a session is mid-turn, busy, or has background tasks, the plan skips
it; re-running later is fine and idempotent.