Repository navigation
Closed
Labels
Description
Tracks open work on how an Automation run executes, ahead of a greenfield exploration of a larger overhaul. The data model and management surface were consolidated in #1717 and #1970. This issue covers the run itself: how a schedule or Event becomes model work, what the run is told, how it decides to act or stay silent, and how it delivers results.
Today every Automation run, whether scheduled or event-driven, goes through the same agent-dispatch path as an interactive chat turn. It uses the shared system prompt plus a dispatch wrapper (#2014). Most of the issues below are symptoms of that framing.
Core execution model
- Automation runs misdescribe delivery and act like chat turns #2014 Automation runs misdescribe delivery and act like chat turns. Covers the wrong delivery target, unattended runs asking questions, the
scheduler/junioractor, the process-report reply contract, prompt-only silence, and credentials discovered mid-run. - Cheaper handling for resource-event turns #1038 Cheaper handling for resource-event turns: every Event runs a full primary-model turn
- Support shared PR-review automations across repositories #1977 Shared PR-review automations across repositories: one trigger resource per Automation, and no per-PR progress across Events
- Add hooks for follow-up actions using a fast model #529 Fast-model follow-up actions after events
- feat(github): plugin-defined reactive behavior hooks #435 Plugin-defined reactive behavior hooks. Overhaul Junior automations #1717 says to replace these with provider Events plus user-owned Automations.
- Reduce background work in archived conversations #1939 Background and watch work keeps running in archived conversations
- feat: adopt core action review in scheduler tools #1051 Action review for scheduler tools: approval policy for durable work
Bugs in current runs
- Scheduler fabricates mention links in task outputs #554 Scheduler fabricates mention links in task outputs
- [[NO_REPLY]] marker leaks into Slack replies #1741
[[NO_REPLY]]marker leaks into Slack replies when mixed with prose - Dispatch turn resume fails to find persisted user message after auth pause #1809 Dispatch turn resume can't find the persisted user message after an auth pause
Triggers and sources
- Add working-days recurrence to the scheduler #450 Working-days recurrence
- Support resource subscriptions for Vercel deploys #938 Vercel deploy Events
- Slack Workflow messages that mention Junior are dropped #2034 Slack Workflow mentions are dropped. This needs a decision on whether scheduled automations are the only supported recurring path.
In-flight PRs
- fix(automations): Require the creator mention in a reply for "me" #2033 Require the creator mention for "me" in reminder replies (draft)
- feat(runtime): cap concurrent and runaway agent work #1197 Cap concurrent and runaway agent work (draft)
- Add install-owned event prompts for Slack root messages #475 Install-owned event prompts for Slack root messages
Prior work
- Overhaul Junior automations #1717 Overhaul Junior automations (closed): one Automation model, ordered outcomes, one execution path
- Make agent automations tool-driven by default #1766 Make agent automations tool-driven by default (closed)
- Make automations easy to manage at scale #1970 Make automations easy to manage at scale (closed)
- Event automation dispatches never count toward the automated-turn limit #2002 Event automation dispatches never counted toward the automated-turn limit (closed)
- Simplify Junior around one core Conversation and optional Location #1563 One core Conversation and optional Location (open): the shared runtime that Automation runs sit on
via David Cramer.
--
Activity
sentry-junior commentedon Oct 6, 2026
Research: structuring the prompt for an automation run
Every system we looked at that handles unattended runs well gives them their own mode and their own contract. Junior instead runs automations as chat turns with a
<dispatch>wrapper on top, which explains most of #2014, #554, and #1741. Junior source was read ata97d616. Prior art was read from source or first-party docs on 2026-10-06.Current behavior (verified)
buildSystemPrompt(platform)inpackages/junior/src/chat/prompt.tsis static per platform. Automation runs inherit interactive rules: ask the user for missing access, "the actor is the person asking now", reply only into the active thread, and[[NO_REPLY]]for silence.<dispatch>block.buildDispatchSectionsays "the runtime delivers the final answer to the destination" and shows the taskdestination, not the resolved outcome destinations. The actor isscheduler/junior, not the creator.renderTaskInputinpackages/junior/src/chat/task-input.tsalready splits event data into trusted summary, verified JSON, and untrusted external text. Prior art does the same. The reply contract is "Briefly report what you did or what is needed next." With outcomes present, conditional silence still depends on an exact[[NO_REPLY]].buildDispatchMetadatainscheduled-automations/heartbeat.tsincludesscheduledFor,runningAt, and the schedule, but nothing about the previous run.Prior art
githubnext/gh-aw@3fd44f8)add_comment,create_pull_request, …), and a separate job applies them afterwards.noop, "even if the workflow prompt forgets to ask fornoop".report_incomplete,missing_tool, andmissing_dataroute to maintainers, not to the output destination.skip-if-match/skip-if-no-matchchecks run deterministically before the agent starts.accepted/rejected/ignoredfrom repository state.<routine-fire-payload>block, and the prompt must opt in to acting on it.openai/codex@0b863c6)collaboration-mode-templates/,approval_policy/never.md), and user or tool content can't change the mode.request_user_inputis usable "only when it is listed in the available tools". Unattended runs remove the capability instead of adding prose.codex exec --output-schemagives structured final output.block/goose@2f07ead)instructions(behavior) fromprompt(the job, required in headless mode).response.json_schemais enforced through afinal_outputtool. If the model stops without calling it, the runtime injects "You MUST call thefinal_outputtool NOW".retry.checksrun deterministic success checks after the run.anthropics/claude-code-action@5898584)Proposals (agreed direction for exploration)
Separate automation-run mode. Keep identity, world, and safety shared. Replace the interactive behavior, conversation, and Slack-action sections with an automation section:
Typed terminal contract. This replaces
[[NO_REPLY]]and "briefly report". The run must end with one of:deliver(message): exposed only when asend_messageoutcome exists. The runtime routes it to the stored destinations. The message is the deliverable.no_action(reason): silent success. Logged and visible, never posted.blocked(reason, needs): sent privately to the creator, never to the destination.incomplete(error): goes to the failure path.Final assistant text is never delivered. Inject one nudge if no terminal tool was called, then mark the run
incomplete.Remove capabilities instead of adding prose. Automation runs don't get the ask-user path or OAuth-link prompts. The prompt lists credential state per provider up front (for example
github: creator,notion: not connected). A missing provider that the run needs leads toblocked.Describe the recipient. Build a deliverable block from the resolved outcomes, not the task destination. Examples: "DM to , who wrote this automation" or "#channel; mention where the instruction says me".
<actor>becomes the creator. This removes the need for prompt patches like fix(automations): Require the creator mention in a reply for "me" #2033 and Scheduler fabricates mention links in task outputs #554.Check conditions before acting. Optionally store
whenseparately fromdo. For events, run deterministic filters first, then an optional cheap relevance check, and only then a full run (Cheaper handling for resource-event turns #1038). If a condition can't be verified, callno_action.Previous-run context. Add the last run's time, terminal result, and reason to the prompt so "since last run" is grounded. Per-automation memory comes later, starting with per-PR progress for Support shared PR-review automations across repositories #1977.
Fixed text skips the model. A reminder with fixed text and no live data posts its stored text directly.
Write self-contained instructions at creation time. The creation tool resolves "me", channels, users, and repos into stored fields, and checks that the instruction states what success looks like.
Record terminal results. Store the terminal tool and its reason on every run. The dashboard shows delivered, no action, blocked, or incomplete, and this can later feed evals.
Draft layout
Open questions
blockedreuse auth pause/resume (LangGraph), or always end the run (gh-aw, Claude Routines)?deliverbe a tool, or should the final message be validated against an output schema (Codex)?whenconditions live for scheduled runs, and is a cheap check worth it there?sentry-junior commentedon Oct 6, 2026
Clarification: blocked runs and user-facing errors
A
blockedresult should report a genuine automation issue to the creator, not turn into an open-ended conversational question or disappear as a silent no-op. What qualifies as a real blocker and how to present the error and next steps are UX questions to explore. Keep the run lifecycle question open too: whether the run ends or can resume after the issue is resolved.ref(automations): Trim automation run steering and dedupe dispatch tests
test(automations): Cover automation run results through real agent flows
test(automations): Cover each seen automation run failure with a real…
fix(automations): Read a declared result saved by an earlier slice
fix(automations): Block Event automations on misconfigured runs
test(evals): Check the saved automation result for the old marker case
ref(automations): Trim one-use helpers and repeated run steering
feat(automations): Run automations in their own mode with a declared …
feat(automations): Block an Event automation when its run is blocked (#…
feat(automations): Tell the creator when an automation becomes blocked (
sentry-junior commentedon Oct 11, 2026
Decision: no generic previous-run context for now
We should not add prior-run content or a conversation ID to every automation prompt without a demonstrated use case. For Event automations, the proposed object-scoped conversation continuity in #2084 gives later events about the same work item access to its history; a separate pointer would be redundant. For Scheduled automations, we do not yet have a concrete instruction or eval that needs prior-run context. A prior model-generated result/reason is not authoritative current state and could reinforce a stale or mistaken conclusion; a conversation ID without a specific retrieval use case adds context without clear value.
If a real scheduled use case emerges (for example, reporting changes since the last run), provide the smallest system-verified checkpoint needed—such as a successful-run timestamp or cursor—and retrieve additional history only when the task needs it. Keep this out of the default prompt for now.
sentry-junior commentedon Oct 11, 2026
Scope decision
No active use case is identified for proposals 6 or 9, so we should not add these features now. Generic previous-run context has no demonstrated consumer; Event continuity is covered by the object-scoped conversation approach in #2084, and there is no concrete Scheduled automation need. A separate execution-result field or dashboard is also unnecessary for now: the declared result is already persisted in conversation history, and no active consumer for a duplicate field or view has been identified. Revisit only when a specific automation, user-facing workflow, or operational need requires it.
feat(automations): Limit runs for each event automation (#2117)
sentry-junior commentedon Nov 9, 2026
Closing as mostly shipped: automation mode and declared results (#2052), plus #2095, #2096, and #2117 landed. The remaining children stand alone: #1038, #2034, #2244, #2362, #1977.
Closed during a tracker cleanup. Reopen if this still matters.