fix(cron): preserve active listener execution by default - #3665
Conversation
Letta Code (agent-c2adbf5c-8419-4211-8cd8-3740db164974) Keep Cloud schedules durable without moving implicit cron work off the listener that created it. Explicit Cloud, local, and computer choices remain authoritative. Co-authored-by: Cameron Pfiffer <cameron@pfiffer.org> 👾 Generated with [Letta Code](https://letta.com) Co-Authored-By: Letta Code <noreply@letta.com>
Letta Code (agent-c2adbf5c-8419-4211-8cd8-3740db164974) Ensure schedule commands invoked from agent tools use the listener that owns the current turn instead of a stale installation identity. Co-authored-by: Cameron Pfiffer <cameron@pfiffer.org> 👾 Generated with [Letta Code](https://letta.com) Co-Authored-By: Letta Code <noreply@letta.com>
A managed-sandbox runtime already executes untargeted schedules in the agent's Cloud sandbox, so erroring there broke the most common no-flags `letta cron add` path for no benefit. Resolve sandbox-* runtime ids to an untargeted schedule (the pre-existing behavior) instead of requiring an explicit --runner cloud; external listeners are still targeted, and unregistered/offline/desktop-local runtimes still error with guidance. 👾 Generated with [Letta Code](https://letta.com) Co-Authored-By: Letta Code <noreply@letta.com>
|
Pushed 4c1ad53: managed sandboxes no longer error on default Behavior matrix for default
Implementation: Known remaining gap (follow-up, not this PR): desktop-local sessions still error on the default. They exist only in the desktop's local proxy, not the Cloud environments registry, so Cloud dispatch has no wire to deliver on — making them targetable requires registering the desktop listener in the environments registry first. 👾 Generated with Letta Code |
… computer Bare `letta cron add` from a desktop-local or unregistered runtime errored after #3665, leaving the most common interactive environments with no no-flags path. Cloud scheduling has no wire to deliver into those runtimes (they are not in the environments registry), so the locality-preserving placement is the local scheduler: the schedule is stored in ~/.letta/crons.json with a warning explaining the durability tradeoff, and recurring schedules get a louder caution since "every Monday" pinned to a session is usually not what the user meant. Also rewrites the scheduling-tasks skill around intention (omit the flags; the CLI preserves execution locality so follow-ups never race the active conversation from a second environment), adds the fast-followup vs recurring-job guidance, documents UTC conversion for Cloud cron expressions, and folds in the CLI reference corrections from #3675 (--once, id-or-name lookup, runs history, --every UTC semantics, no in-place editing). Co-Authored-By: Cameron <cameron@pfiffer.org> 👾 Generated with [Letta Code](https://letta.com) Co-Authored-By: Letta Code <noreply@letta.com>
… computer Bare `letta cron add` from a desktop-local or unregistered runtime errored after #3665, leaving the most common interactive environments with no no-flags path. Cloud scheduling has no wire to deliver into those runtimes (they are not in the environments registry), so the locality-preserving placement is the local scheduler: the schedule is stored in ~/.letta/crons.json with a warning explaining the durability tradeoff, and recurring schedules get a louder caution since "every Monday" pinned to a session is usually not what the user meant. Also rewrites the scheduling-tasks skill around intention (omit the flags; the CLI preserves execution locality so follow-ups never race the active conversation from a second environment), adds the fast-followup vs recurring-job guidance, documents UTC conversion for Cloud cron expressions, and folds in the CLI reference corrections from #3675 (--once, id-or-name lookup, runs history, --every UTC semantics, no in-place editing). Co-Authored-By: Cameron <cameron@pfiffer.org> 👾 Generated with [Letta Code](https://letta.com) Co-Authored-By: Letta Code <noreply@letta.com>
… computer Bare `letta cron add` from a desktop-local or unregistered runtime errored after #3665, leaving the most common interactive environments with no no-flags path. Cloud scheduling has no wire to deliver into those runtimes (they are not in the environments registry), so the locality-preserving placement is the local scheduler: the schedule is stored in ~/.letta/crons.json with a warning explaining the durability tradeoff, and recurring schedules get a louder caution since "every Monday" pinned to a session is usually not what the user meant. Also rewrites the scheduling-tasks skill around intention (omit the flags; the CLI preserves execution locality so follow-ups never race the active conversation from a second environment), adds the fast-followup vs recurring-job guidance, documents UTC conversion for Cloud cron expressions, and folds in the CLI reference corrections from #3675 (--once, id-or-name lookup, runs history, --every UTC semantics, no in-place editing). Co-Authored-By: Cameron <cameron@pfiffer.org> 👾 Generated with [Letta Code](https://letta.com) Co-Authored-By: Letta Code <noreply@letta.com>
Summary
letta croncommand cannot select a stale installation ID.--computerselects a device,--runner cloudselects the Cloud sandbox, and--runner localstays process-local.Before / after
Before,
letta cron addwithout runner flags omittedtarget_device_id, so work created on a connected listener ran in the Cloud sandbox.After, the CLI resolves the listener that owns the current turn, verifies that it is a live external environment, and stores it in the existing
target_device_idfield. Existing targetless schedules keep their historical Cloud-sandbox behavior.Limits
Managed sandboxes and Desktop local-proxy connections are not accepted by the current Cloud schedule target API. The CLI reports that limit and gives explicit alternatives instead of claiming local execution.
Test plan
bun test src/cli/subcommands/cron.test.ts src/cli/subcommands/cron-runner.test.ts src/backend/api/client.test.ts src/tools/shell-env.test.ts(64 pass)bun run check(12/12 checks pass)letta cron runsreportedstatus: success,delivery: device, and the exact listener connection. The temporary schedule and listener were removed.👾 Generated with Letta Code