算法艺术创作
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 → respects prompt cache 5-min TTL + scheduler whole-min granularity + [60, 3600] clamp. Non-trivial: "wait ~5 min" → worst-of-both zone → pay cache miss without amortizing wait.
Reasoning travels w/ ScheduleWakeup tool desc at call time → but loop already scheduled. This skill hoists reasoning → planning time.
/loop or ScheduleWakeup continuation → pick per-tick delaydelaySeconds exampleTier decision:
→ Classification: active-watch, cache-miss, or idle.
If err: Can't classify → no honest answer to "what waiting for?" → loop shouldn't exist → skip to Step 5.
Pick delaySeconds:
| Tier | Range | Cache | Use when |
|---|---|---|---|
| Cache-warm | 60 – 270 s | Warm (<5-min TTL) | Active watch — fast cheap re-entry |
| Cache-miss | 1200 – 3600 s | Cold; miss buys long wait | Idle, or event can't happen sooner |
| Idle default | 1200 – 1800 s (20–30 min) | Cold | No specific signal; periodic |
Do not pick 300 s. Worst-of-both: cache misses, wait too short to amortize. Reaching for "~5 min" → drop to 270 s (warm) or 1200 s+ (amortize).
→ Specific delaySeconds from one of three tiers, not round-minute habit.
If err: Keep landing on 300 s → real question is "should loop exist at this cadence?" → re-examine Step 1.
Scheduler fires on whole-min boundaries. delaySeconds = N → actual N to N + 60 s, depending on call second.
Example:
ScheduleWakeup({delaySeconds: 90})atHH:MM:40→ targetHH:(MM+2):00→ actual 140 s, not 90 s.
Sub-minute intent meaningless. Value = floor, not precise. Min of skew matters → cadence too tight for this mech.
→ Accepted actual wait up to 60 s longer than requested. Cache-warm: 270 s → ~330 s → tips into cache-miss.
If err: Near-ceiling values common (265 s for cache-warm) → pad down → 240 s preserves warmth under worst-case skew.
Runtime clamps delaySeconds → [60, 3600]. Out-of-range → silently adjusted. Telemetry: chosen_delay_seconds vs. clamped_delay_seconds + was_clamped: true.
Plan vs. clamped, not requested:
→ Value in [60, 3600] or clamp accepted.
If err: Genuinely multi-hour ("wake in 4 h") → chain wakeups (3600 s tick reschedules) or cron loop (CronCreate w/ kind: "loop").
reasonreason = telemetry + user status + cache-warmth reasoning. 200-char limit. Specific.
checking long bun build, polling for EC2 instance running-state, idle heartbeat — watching the feedwaiting, loop, next tick, continuingReader = user glancing at status → write for them.
→ Concrete one-phrase reason sensible to glancing user.
If err: No specific reason → revisit loop existence (Step 1, Step 6).
Not every "come back later" = scheduled wakeup. Do NOT schedule when:
→ Conscious choice: schedule wakeup vs. no loop. "Because I could" ≠ reason.
If err: User keeps interrupting wakeups → pattern wrong, not interval.
delaySeconds in one of three tier ranges (60–270, 1200–3600, 1200–1800 idle)[60, 3600] or clamp explicitly acceptedreason concrete + <200 charsreason: "waiting" = nothing. Write for user status line.bun build kicked off → agent checks quick → cache warm at results.
checking long bun buildAutonomous agent watches low-volume feed 1×/h.
idle heartbeat — watching the feedAgent wants "wait 5 min" → remote API retries → 300 s req.
manage-token-budget — cost ceilings; cache-aware sizing is one leverdu-dum — observe/act pattern; this skill sizes observe-clock when cron-lessread-continue-here — cross-session handoff; this = within-session wakeupswrite-continue-here — complement of read-continue-here