Scheduling primitive used as a wait mechanism for background subagents triggers an unwanted autonomous-loop tick
Summary
While executing subagent-driven development (dispatching background implementer/reviewer subagents), the agent called the scheduling primitive (ScheduleWakeup / cron-style wakeup) with a short delay (~300s) purely as a wait mechanism to poll for subagent completion.
Side effect: the scheduled wakeup fired as an autonomous-loop tick — the agent "woke up" in a fresh autonomous round it never intended to start, instead of simply resuming the conversation that was waiting on its subagents.
What happened
- Agent dispatches background subagents (implementer/reviewer pattern).
- To wait for them, the agent calls
ScheduleWakeupwith a 300s delay (treating it as a sleep/poll timer). - When the wakeup fires, the runtime treats it as an autonomous-loop tick — starting an unwanted autonomous cycle (fresh context, loop machinery engaged), rather than resuming the pending conversation turn.
Expected behavior
A wakeup scheduled while the agent is actively waiting on background subagents should resume the conversation that scheduled it (continuation semantics), not trigger an autonomous-loop round.
Alternatively (cleaner API): the platform should expose a first-class "await subagent completion" primitive (blocking subagent call, or spawn + pollable spawn_status within the same turn), making timer-based polling unnecessary.
Suggested fix directions
- Attribution: tag wakeups with their source/reason. A wakeup scheduled from an active conversation with pending background tasks should be routed back to that conversation, not to the loop scheduler.
- Guardrail: when background subagents are pending, either block
ScheduleWakeupwith a clear error, or auto-convert it into a subagent-completion wait. - Docs: document that scheduling primitives are loop-tick triggers, not sleep/wait mechanisms — any agent prompt that hints "schedule a wakeup to check later" invites this bug.
Environment
- Deployment: picoclaw gateway running as compiled Go binary (
/app/picoclaw-gateway, linux/arm64) — build embedsgithub.com/sipeed/picoclawsources; exact version string not exposed via/health. - Observed via the framework's own bug-report triage queue (drafted automatically during a real working session).
- Note: searched upstream code and issues for
ScheduleWakeup— no existing issue or code match found, so filing as new.
Workaround
Instructed the agent persona to never use scheduling primitives as a wait mechanism: use the synchronous subagent tool (blocks and returns the result), or spawn + spawn_status polling within the same turn. This eliminates the unwanted ticks in practice, but the API trap remains for any other deployment.
Source: sipeed/picoclaw