Routine launcher: always send a trigger mail, even with no stored input - #328
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
apps/hub/src/routine-launcher.tsdeploys every routine run underAGENT_SECTION_MODE— anonTriggersection (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.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 inputWORKBENCH_CHECK_SINCE=origin/main bun run typecheck— passWORKBENCH_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)