
Ao Answer
Find AO sessions that wait on the user, show each question or approval as tap-to-answer...
Install
npx skills add OrchestratorInc/agent-orchestrator --skill ao-answer -g -a claude-code -y- Repository
- OrchestratorInc/agent-orchestrator14k
- Category
- Engineering
- Updated
- 3d ago
- License
- Apache-2.0
- Context cost
- Lightabout 1,326 tokens
- Runs scripts
- No, instructions only
What it does
Find AO sessions that wait on the user, show each question or approval as tap-to-answer options, and send the answer back to that session, following ao-rules "Decisions" (default, away mode, standing approvals). Use for "what's waiting on me", "answer <session>", "approve it", the AO waiting check routine, and away mode.
Follow the ao-rules skill. Its "Decisions" section says who may answer. Answers go straight to the worker, not through the orchestrator: the user's pick must arrive exactly as given.
1. Find what's waiting
On every host, in parallel:
f(){ <aoapi helper>
aoapi GET 'sessions?active=true' | python3 -c '
import json,sys,time,calendar
now=time.time()
for s in json.load(sys.stdin)["sessions"]:
st=(s.get("activity") or {}).get("state"); t=(s.get("lastEventAt") or "")[:19]
if st in ("waiting_input","blocked"): print("W", s["id"])
elif st=="idle" and t and now-calendar.timegm(time.strptime(t,"%Y-%m-%dT%H:%M:%S"))<86400: print("I", s["id"], s.get("lastEventAt"))' |
while read -r k id at; do
if [ "$k" = W ]; then
aoapi GET "sessions/$id/conversation" | python3 -c '
import json,sys
d=json.load(sys.stdin); found=False
for a in d.get("activities") or []:
if a.get("activityKind") in ("approval","user_input") and a.get("status")=="pending":
found=True; print(json.dumps({"session":sys.argv[1],"kind":a["activityKind"],"requestId":a.get("requestId"),
"summary":a.get("summary"),"decisions":a.get("decisions") or (a.get("detail") or {}).get("decisions"),"detail":a.get("detail")}))
if not found: print(json.dumps({"session":sys.argv[1],"kind":"reply"}))' "$id" 2>/dev/null
else
aoapi GET "sessions/$id/history?offset=0&limit=1" | python3 -c '
import json,sys,re
t=(json.load(sys.stdin).get("turns") or [{}])[0]; r=(t.get("agentResponse") or "").strip()
if re.search(r"\?[\s*_`)\]]*$", r): print(json.dumps({"session":sys.argv[1],"kind":"reply","lastEventAt":sys.argv[2],"asked":r[-300:]}))' "$id" "$at" 2>/dev/null
fi
done; }; f
Each line is one thing waiting:
