Reactive loop
Your home agent reacts to Sprout-pushed events: approve a screen-time request by rule, defer the ambiguous ones to the parent through a skill. Push twin of Autonomous loop.
What you'll build
Sprout pushes an event to your home agent. Your agent decides what to do based on rules you set, then acts: approve a screen-time request that fits the kid's plan, reject one that doesn't, defer to the parent through a skill when the call isn't clear-cut.
This is the push twin of Autonomous loop. Autonomous fires on your agent's clock; Reactive fires on Sprout's events. Same shape (read, decide, act), different trigger.
Pieces you'll combine
- Subscriptions over SSE: the push channel from Sprout.
resources/subscribeon a specific resource URI. - Your home agent's rules engine: lives on your side. The "approve a screentime request under N minutes if today's screen budget isn't blown" logic.
- The matching action tool:
screentime.review_request,task.review,gems.adjust, etc. Whichever one closes the loop on the event you received. - A deferral skill: when the rule says "ask the parent", invoke a
home_agentskill that posts the question to the family inbox viaskill.post_result. The parent decides in-app.
Build it
Four movements:
1. Subscribe to a channel. Pick the resource URI that matches the event you want to react to.
resources/subscribe sprout://child/{kidId}/screentime/requests
# Open SSE stream; events arrive whenever the kid requests screen time.
# See /docs/reference/subscriptions for the full channel list.2. On each event, evaluate. Your agent's rules: kid's earned gems, today's plan, time of day, what's still on the schedule. Make the decision local; don't round-trip a model call for every event if you don't have to.
3a. Act directly if the call is clear.
// Auto-approve a 15-min request when the kid still has budget.
screentime.review_request({
requestId: "<event.requestId>",
approve: true,
note: "auto-approved: within today's budget"
})3b. Defer to the parent if it's ambiguous. Wrap the question in a skill so the parent sees it in the family inbox and decides in-app.
skill.invoke({
skillId: "<parent-decision-skill>",
input: {
question: "Alex is asking for 30 more minutes after dinner. Budget is at 80%. Approve?",
options: ["Approve", "Approve 15min only", "Reject"],
callbackTool: "screentime.review_request",
callbackArgs: { requestId: "<event.requestId>" }
}
})
# The skill posts a card via skill.post_result; the parent taps in-app.
# Sprout's in-app agent calls the callback tool with the parent's choice.4. Keep the loop open. SSE streams stay open; your agent stays subscribed. Reconnect on drop. Idempotency keys on action calls protect against duplicate events.
When to use it
- Sprout is the source of truth for state changes you want to react to (screentime requests, gem milestones, task completions, parent-review pending).
- The decision can usually be made by rule, with a fallback to the parent for the edge cases.
- Anti-pattern: polling on a heartbeat for things that have a push channel. Use the subscription.
- Anti-pattern: deciding everything by hand-typed parent input. Encode your common rules; reserve deferral for the ambiguous N%.
Tools touched
resources/subscribe: the SSE channels.child/screentime/requestsandchild/gemsshipped;child/todayandfamily/activitySoon.- Whatever action tool closes the loop:
screentime.review_request,task.review,gems.adjust, etc. skill.invoke+skill.post_resultfor the parent-deferral path.
Recommended skills
No skills in the catalog pair with this pattern yet. Browse the catalog.
Roadmap
- Soon More channels.
child/today(full day state, push on change) andfamily/activity(the family feed as a stream) ship next. - Soon Deferral pattern as a first-class tool. A platform-level "ask the parent" tool so you don't have to build the skill yourself.
Seen in walkthroughs
Not yet. A "screentime auto-approver" walkthrough is on the list.
Related patterns
- Autonomous loop: the pull twin. Your agent on its own clock.
- Context bridge: also home-agent-side, but flowing the other direction (outside → Sprout).
- Reports and briefs: pair with this pattern to post the post-decision summary to the family inbox.