Skip to content

Routine launcher: always send a trigger mail, even with no stored input - #328

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-routine-delivery
Aug 22, 2026
Merged

Routine launcher: always send a trigger mail, even with no stored input#328
TheGreatAxios merged 2 commits into
mainfrom
cl-routine-delivery

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

  • Fixes CL-6678: on a fresh tenant, "Run now" on a routine with no separately-stored input never delivered anything and stayed stuck "RUNNING NOW" forever, while Mission Control simultaneously showed 0 active runs.
  • Root cause: apps/hub/src/routine-launcher.ts deploys every routine run under AGENT_SECTION_MODE — an onTrigger section (CL-6329/CL-6367) whose one and only occurrence starts in response to an inbound mail. When the routine had no separately-collected stored input, the launcher skipped sending any trigger mail at all (a stale comment described the pre-CL-6367 "starts from the system prompt alone" behavior). With no mail, the section never fires a single occurrence — the run deploys, connects, and then sits silent forever.
  • Fix: always send a trigger mail, substituting a placeholder ("Run this routine now.") when the routine's stored input renders empty — mirroring triggerNativeWorkflowRoutineRun's existing handling of the same case for multi-step routines.

Test plan

  • bun test apps/hub/src/routine-launcher.test.ts — 11/11 pass, including the updated test asserting a placeholder trigger mail is sent on empty stored input
  • WORKBENCH_CHECK_SINCE=origin/main bun run typecheck — pass
  • WORKBENCH_CHECK_SINCE=origin/main bun run test — 155 pass / 0 fail (181 total incl. skips)
  • bun run lint — 0 errors (pre-existing unrelated warnings only)
  • Live verification against quinn's tenant (create a new routine with no stored input, Run now, confirm delivery lands and status goes terminal) — not yet re-driven in this session; ticket CL-6678 carries the repro steps for restart-verify

A section-mode routine run's onTrigger occurrence only starts in
response to inbound mail; skipping mail on empty stored input leaves it
permanently un-triggered. This test currently fails against the
existing implementation.
Routine runs deploy under AGENT_SECTION_MODE, an onTrigger section
whose one and only occurrence starts in response to an inbound mail
(CL-6329/CL-6367). Skipping mail when the routine's stored input was
empty — the pre-CL-6367 "starts from the system prompt alone" behavior
— left the section with zero occurrences: deployed, never delivering,
stuck "running" forever, exactly the CL-6678 repro. Mirrors
triggerNativeWorkflowRoutineRun's own placeholder substitution for the
multi-step path.
@TheGreatAxios
TheGreatAxios merged commit 5f714c1 into main Aug 22, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant