Repository navigation
Replies: 4 comments
|
Opened #4494 for the plumbing this proposal needs: pointing a schedule at an agent session that already exists. This proposal is a superset — it also asks for limit detection, the composer banner, and the pending-wake-up chip, and none of that is in #4494. Keeping them separate so the smaller piece can be discussed without deciding the detection design. |
|
You can build the resume half of this as a plugin today. const usage = await paseo.providers.listUsage();
// usage.providers[].windows[].resetsAt
await paseo.agents.ref(agentId).send("continue");That is not the proposal. There is still no rate-limit classification on a failed turn, no composer banner, and no pending wake-up chip, so a plugin has to decide for itself which agent to resume and when. The method is documented in the SDK reference and landed in #4062. NaruForge's Provider Usage plugin already reads usage through it if you want a working example of the read side. Thanks for writing this up with the quota-fetcher detail. It made it easy to check what was already reachable from outside the daemon. |
|
I built a plugin recently for this: https://github.com/InfinityMod/paseo-wakeup Feel free to use it. |
|
I implemented a related approach in #7193, and am exploring whether it could move into a plugin. I saw the existing paseo-wakeup plugin linked above; it is useful context for that decision. There are a few differences from the original proposal:
The main question for a plugin version is access to the structured failed-turn metadata: the current lifecycle hook exposes the error message/code, but not the limit/reset payload. Is there an existing plugin route to this data, or would a small SDK extension be useful for this and similar automation? |
Uh oh!
There was an error while loading. Please reload this page.
Problem
Claude Code and Codex enforce rolling usage limits — a 5-hour window, plus weekly caps. A long-running task that hits the limit dies mid-turn, and the agent sits idle until the window resets. Today your options are:
The information needed to do better already exists: the daemon's quota fetcher knows the exact reset time for Claude's 5h/weekly windows and Codex's primary/secondary windows. It just never reaches the agent lifecycle.
Proposal
When a turn fails because of a usage limit, the composer offers a one-tap wake-up:
Detection — the daemon classifies the failed turn as rate-limited (error heuristics, cross-checked against a forced quota refresh, which also yields the authoritative reset time).
Banner above the composer — instead of a bare error state, the composer shows:
One tap creates the schedule — a one-shot schedule targeting this agent, firing at the reset time (plus a small buffer), sending a continue prompt into the same session.
It stays visible while it waits — until it fires, the pending wake-up floats above the composer as a chip with a countdown, one tap to cancel:
Consent happens once, at the moment of failure. No setting to discover in advance, no quota burned unattended by default — and unlike a blind cron, you can always see that the agent will wake itself, and how to stop it.
Why a schedule, and not a timer inside the agent
A wake-up should survive daemon restarts, be inspectable in the schedules list, and be cancellable from the same place as every other schedule. The schedule service already is that: persisted storage, a tick loop, and an existing target type that delivers a prompt to an existing agent (
ScheduleTargettypeagent). The feature composes two things Paseo already has, rather than adding a third way to resume an agent.What exists today
resetsAtfor Claude's 5h window and weekly limits, and Codex's primary/secondary windows (packages/server/src/services/quota-fetcher/). Currently feeds the quota UI only.formatSystemNotificationPrompt) exists for injected "continue" prompts.What's missing
ScheduleCadenceonly supportseveryandcron. A wake-up wants "fire once at time X, then complete" — likely a third cadence variant rather than a fake cron expression.Open questions
resetsAtmay be null or days away — a wake-up doesn't help. Degrade to a plain notification ("limit reset, tap to resume") in that case?resetsAt+ a minute or two, and re-check the quota before sending — if the window hasn't actually reset, recompute the next wake-up instead of sending into a wall.All reactions