算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
choose-loop-wakeup-interval【设计与创意】Select a `delaySeconds` value when scheduling a loop wakeup via the `ScheduleWakeup` tool or the `/loop` slash command. Covers the three-tier cache-aware decision (cache-warm under 5 minutes, cache-miss 5 minutes to 1 hour, idle default 20 to 30 minutes), the 300-second anti-pattern, the [60, 3600] runtime clamp, the minute-boundary rounding quirk, a…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
delaySeconds value when scheduling a loop wakeup via the
ScheduleWakeup tool or the /loop slash command. Covers the three-tier
cache-aware decision (cache-warm under 5 minutes, cache-miss 5 minutes to
1 hour, idle default 20 to 30 minutes), the 300-second anti-pattern, the
[60, 3600] runtime clamp, the minute-boundary rounding quirk, and writing
a telemetry-worthy reason field. Use when designing an autonomous loop,
when a heartbeat cadence is being planned, when polling cadence is being
tuned, or when post-hoc review of loop costs reveals interval mis-sizing.
license: MIT
allowed-tools: ""
metadata:
author: Philipp Thoss
version: "1.0"
domain: general
complexity: intermediate
language: multi
tags: loop, wakeup, cache, scheduling, delay, generalPick delaySeconds for ScheduleWakeup. Respect prompt cache 5-minute TTL, scheduler whole-minute granularity, [60, 3600] runtime clamp. Instinct "wait about 5 minutes" lands in worst-of-both zone — pay cache miss without amortizing wait.
Reasoning travels with ScheduleWakeup tool description at call time, but by then loop already scheduled. This skill hoists reasoning to planning time, where it belongs.
/loop or ScheduleWakeup-driven continuation. Pick per-tick delay.delaySecondsPick tier:
Got: Clear classification: active-watch, cache-miss, or idle.
If fail: Cannot classify? No honest answer to "what am I waiting for?" → loop probably should not exist. Skip to Step 5. Consider not scheduling at all.
Pick delaySeconds from classification:
| Tier | Range | Cache behaviour | Use when |
|---|---|---|---|
| Cache-warm | 60 – 270 s | Cache stays warm (under 5-minute TTL) | Active watch — next tick needs fast, cheap re-entry |
| Cache-miss | 1200 – 3600 s | Cache goes cold; one miss buys long wait | Genuinely idle, or awaited event cannot happen sooner |
| Idle default | 1200 – 1800 s (20–30 min) | Cache goes cold | No specific signal; periodic check, user can interrupt |
Do not pick 300 s. Worst-of-both interval: cache misses, but wait too short to amortize miss. Reaching for "about 5 minutes"? Drop to 270 s (stay warm) or commit to 1200 s+ (amortize miss).
Got: Specific delaySeconds from one of three tiers. Not round-number-minute picked from habit.
If fail: Choice keeps landing on 300 s? Underlying question: "should this loop exist at this cadence at all?" Re-examine Step 1.
Scheduler fires on whole-minute boundaries. delaySeconds of N produces actual delay of N to N + 60 s. Depends on what second of minute you call tool.
Worked example:
ScheduleWakeup({delaySeconds: 90})atHH:MM:40→ targetHH:(MM+2):00. Actual wait 140 s, not 90 s.
Consequence: sub-minute intent meaningless. Treat value as floor, not precise schedule. If minute of skew matters, loop cadence too tight for this mechanism.
Got: Accepted: actual wait up to 60 s longer than requested delaySeconds. Cache-warm ticks affected — 270 s can become ~330 s in practice, tipping into cache-miss territory.
If fail: Near-ceiling values (e.g., 265 s targeting cache-warmth) common? Pad downward. Use 240 s instead of 270 s. Preserves cache-warm guarantee under worst-case skew.
Runtime clamps delaySeconds to [60, 3600]. Outside range silently adjusted. Telemetry distinguishes chosen_delay_seconds from clamped_delay_seconds. Sets was_clamped: true on mismatch.
Plan against clamped value, not requested:
Got: Chosen value falls inside [60, 3600]. Or clamped behaviour deliberately accepted.
If fail: Need genuinely multi-hour (e.g., "wake me in 4 hours")? Chain wakeups — schedule 3600 s tick that reschedules itself. Or use cron-based loop (CronCreate with kind: "loop").
reasonreason field = telemetry + user-visible status + prompt-cache warmth reasoning. One line. Truncated to 200 chars. Make specific.
checking long bun build, polling for EC2 instance running-state, idle heartbeat — watching the feedwaiting, loop, next tick, continuingReader: user trying to understand what loop is doing without predicting cadence in advance. Write for them.
Got: Concrete, one-phrase reason. Makes sense to user glancing at status.
If fail: No specific reason available? Revisit whether loop should exist (Step 1, Step 6).
Not every "come back later" impulse warrants scheduled wakeup. Do NOT schedule tick when:
Got: Conscious choice between scheduling wakeup and not looping. "Because I could" not a reason.
If fail: Keep scheduling wakeups user interrupts before they fire? Pattern is wrong — not interval.
delaySeconds falls in one of three tier ranges (60–270, 1200–3600, or 1200–1800 for idle)[60, 3600] or clamped behaviour explicitly acceptedreason concrete, under 200 charsreason fields: "waiting" tells user nothing. Telemetry useless. Write reason as if user reads it on status line.bun build kicked off. Agent wants to check in quickly, cache still warm when results arrive.
checking long bun buildAutonomous agent watches low-volume feed once an hour for anything worth acting on.
idle heartbeat — watching the feedAgent wants to "wait 5 minutes" while remote API retries. Request is 300 s.
manage-token-budget — cost ceilings for long-lived agent loops; cache-aware sizing one leverdu-dum — observe/act separation pattern; sizes observe-clock interval when loop is cron-lessread-continue-here — cross-session handoff; this skill covers within-session wakeupswrite-continue-here — complement of read-continue-here