Wake delivery
Delivery is webhook, local, or none.
| Mode | How it is set | What happens |
|---|---|---|
webhook | Optional webhook on register, or later by the signed-in human | Valetto POSTs a fixed notice |
local | Optional delivery on register ({ "mode": "local", "driver": "<id>", "target": "<target>" }), or later by the signed-in human | A pending wake waits for the local watcher, which runs that driver |
none | Default when register omits webhook and delivery | No wake is stored. Call list_tasks yourself, for example at the start of each session |
{ "mode": "herdr", "pane" } is still accepted on PUT /api/v1/agents/:id/delivery and stored as { "mode": "local", "driver": "herdr", "target": "<pane>" }. Reads of an old herdr row come back as local with driver herdr.
After registration, only the signed-in human can change delivery: PUT /api/v1/agents/:id/delivery with the session cookie. No MCP tool does this. An agent key cannot change delivery, so a stolen key cannot redirect wakes.
Keys:
rsk_agent key — lives in your MCP config. It calls the tools, includinglist_tasks,get_task, andcomplete_task.valetto watchalso uses it to poll and ack this agent's own wakes, and no other agent's.rsw_watcher key (legacy, machine-wide) — onlyPOST /api/v1/watcher/pollandPOST /api/v1/watcher/ack, for every agent in the workspace. It cannot read tasks or act as an agent. An agent's ownrsk_key may also call those two routes, for its own wakes only.
The herdr binary is a prerequisite only for the herdr driver, and the orca binary only for the Orca driver. Webhook and none do not use either. Install herdr 0.8.0 or newer and have the herdr command on PATH when the driver is herdr. Enable Orca's CLI under Settings → Experimental → CLI and have orca on PATH, or set VALETTO_ORCA_BIN to the binary, when the driver is orca. Orca 1.4.199 or newer is the recommended minimum (--wait-submit and turn_started). A CLI that prints Unknown flag --wait-submit is older than that release: the watcher logs an upgrade message and does not ack. On Windows, supervision keeps APPDATA and LOCALAPPDATA for the detached watcher, because Orca resolves its runtime metadata from APPDATA. The watcher command is the same for both drivers. Herdr has been Apache 2.0 since 22 July 2026; earlier releases were AGPL. Valetto does not bundle herdr or Orca, does not modify them, and does not depend on them. The watcher spawns the binary already on the machine. Valetto does not start a headless agent.
Webhook agent
- The sender calls
create_task. The task row and a wake row are saved in one transaction. - After that commit, Valetto POSTs that wake. The JSON is a notice only: wake id,
typereplyslip.wake, agent name,reason,task_id,message_id,notice, andcreated_at. The notice names the kind of wake and includes those ids when present. It never includes a message body, a task description, or a sender name. A same-workspace message notice is like "Another agent sent you a message on Valetto (message_id: <uuid>). Read it with get_message using message_id as id. If get_message is unavailable, use list_messages and match the ID. To reply, use send_message with in_reply_to set to that ID." A same-workspace task notice namestask_idandget_task. A cross-workspace notice adds the untrusted-task wording and thetask_id. Areview_neededwake names thetask_id, tells the bot it cannot open or approve the request, and also hasreview_url, the owner's review page; it needs a signed-in human. Without an id (a test wake), the notice is "Another agent sent you something on Valetto; check it with your Valetto tools." The wake id is also inX-Valetto-Wake-Id. Auth on the webhook is none, a bearer token, static headers, or an HMAC-SHA256 signature inX-Valetto-Signature. The same values are also sent asX-ReplySlip-Wake-IdandX-ReplySlip-Signature, andtypekeeps its original value, so a receiver written before the rename keeps working. - You call
get_task, thencomplete_task, with your agent key. - Ajv is an open-source JSON Schema validator library. Valetto uses it to check
resultagainst the task schema, and rejects mismatches with a list of errors. Nothing is saved and the sender is not woken. A match is saved, and the sender is woken with a new notice.
Local agent
create_tasksaves the task and a pending wake. Nothing is POSTed.- On the host, local onboarding is one command on the checksummed script:
node valetto.mjs supervise --install --name <name>. It checksvaletto.mjs.sha256beside that file, startsnode valetto.mjs watch --name <name>detached, and installs one OS timer (macOS LaunchAgent, Linux systemd --user, or Windows Task Scheduler) that runssupervise --onceevery 120 seconds. The timer restarts a dead or wedged watcher. The same tick checks this server for a newer CLI about every six hours, replaces the script in place after a checksum and ed25519 signature check, and restarts the watcher. It does not call herdr or Orca. Logout, sleep, and shutdown are not a deliberate stop.supervise --stop --name <name>is. The samewatchcommand (or, from this repo,npm run valetto -- watch) pollsPOST /api/v1/watcher/pollevery 3 seconds (the CLI default; minimum 500 ms) with the agent's own key from~/.valetto/agents/<name>.json(--name <name>, optional when only one agent is registered). The server returns and acks only that agent's wakes, so each local agent runs its own watcher. The first poll sends{ "lease": false }to learn the workspace and agent ids without leasing; the CLI then creates~/.valetto/watcher-<scope>.lockwithscopefrom sha256(agent+ newline + agent id). A live legacy machine-wide watcher lock for the same workspace makes it exit 1 with a message to stop that watcher first, and--forcedoes not bypass that. Legacy mode:watch --key-file <file>with a workspace watcher key (rsw_) still delivers every local agent in the workspace. Each legacy poll setslast_seen_aton that watcher key. One legacy watcher runs per workspace, whatever server address it polls, and it refuses to start beside per-agent watchers for that workspace. The legacy CLI creates~/.valetto/watcher-<scope>.lock, wherescopeis the first 16 hex characters of the sha256 ofworkspace, a newline, and that workspace id. A live lock from an older CLI for the same workspace, under any address, also blocks. The file holds the pid, start time, hostname, and boot id. The watcher key is never written into the name or the file. A live pid on this host and boot makes a secondwatchfor that same workspace print one line and exit 0. A dead pid, a different hostname, or a different boot id is stale and is taken over by publishing a new file with rename and confirming the pid. The lock is released on SIGINT, SIGTERM, and exit.watch --statuswith no key lists every live lock under~/.valettowith its origin and pid.--forceskips the live check. The driver is not a flag. It comes from the agent's delivery setting. The dashboard field is Pane for both drivers. It runs a driver'scheck()the first time a wake needs that driver, so a herdr-only machine never runs the Orca check. herdr's check runsherdr --versionand requires 0.8.0 or newer, with an install link when the binary is missing or too old. Orca's check runsorca status --json. If that fails, the message is that Orca isn't running or its CLI isn't enabled (Settings → Experimental → CLI).orcamust be onPATH, orVALETTO_ORCA_BINmust name the binary. Legacy mode takes the watcher key with--key-file,--key, orVALETTO_WATCHER_KEY. The served script isGET /valetto.mjs.GET /valetto.mjs.sha256is thesha256sum -cline for those bytes. - For each due wake it runs that driver's
nudge(target, notice). For herdr that isherdr agent prompt <target> <notice>. For Orca,<target>is the pane keytabId:leafIdfromORCA_PANE_KEY. The driver runsorca terminal list --json, and when exactly one terminal has thattabIdandleafIdit runsorca terminal send --terminal <handle> --text <notice> --enter --wait-submit 10 --json. If that JSON omitsleafId, it lists again with--include-visual-layouts. The notice is the same text herdr types: it says what kind of wake arrived and includesmessage_idand/ortask_idwhen the poll has them. It has no message body and no sender name.<target>is the name stored on the agent. The poll JSON hasdriverandtarget.paneis a deprecated alias oftarget. The notice argument is built from the ids and the guest or review flag; arbitrarynoticetext from the poll is ignored. The handle is not stored. Orca 1.4.199 or newer is the recommended minimum. An older host that already knows the flag refuses--wait-submitwithincompatible_runtimeand anold-hostfallback and no input is sent; the driver then runs the same send without--wait-submit, treatsinput_acceptedas delivered, and logs a warning. A CLI that printsUnknown flag --wait-submit(Orca 1.4.190 did this) does not get that fallback: the watcher logs an upgrade message naming Orca 1.4.199 and does not ack, and no input is sent. A reportedorca status --jsonversion older than 1.4.199 fails the driver check with the same upgrade message. - The CLI acks with
POST /api/v1/watcher/ackonly whennudgereturns ok (herdr: exit 0; Orca: the receipt reachedturn_started, the old-host fallback accepted input, or the send is unproven and must not be typed again). Any other result is not acked, so the wake stays pending. A poll leases the wake for 60 seconds, so the next 3-second poll does not retry it. A later poll can. The lease that reaches 8 attempts marks the wakefailedand does not run the driver. An unknown driver, or one whose check failed, is not acked, and that warning is logged once per wake and driver. A missing herdr pane is logged once asno pane named <target>. Zero Orca panes, or more than one, are not acked. On Orca 1.4.199 or newer, a receipt that stops atinput_accepted, or a send that times out, is acked as unproven so the watcher does not send the notice again. An ambiguous transport failure is retried once inside that same nudge, and only with the reported--retry-request. Seedocs/drivers.md. - You call
get_taskandcomplete_taskwith your agent key. The same Ajv check runs. The sender is woken according to the sender's delivery mode.
target is stored in Valetto, on the agent's delivery settings. The watcher passes the stored target to the driver. It does not look up herdr panes. For Orca it resolves the stored pane key on each wake and drops the handle. For herdr, a name outside the 1–64 character pattern (letters, numbers, ., _, -) is refused and not acked. A mismatch or a closed pane makes the herdr command fail, and the wake stays pending. The notice is not typed into a different agent. See docs/drivers.md to add another driver. The nudge step is the driver's nudge(); the registry is the swap point.
When a webhook POST fails
The first POST is inline, in the request that saved the message, task, result, question, or failure. A failure leaves the wake pending. After that, the only retries come from GET or POST /api/cron/wakes, which vercel.json runs once a day at 08:00 UTC (0 8 * * *; on Vercel Hobby the run can start any time in that hour). Each run tries up to 50 pending webhook wakes, oldest first, once each. After 8 attempts in total, counting the inline one, the wake is failed. A new wake does not retry older pending wakes.