Repository navigation
Description
This issue tracks a set of self-contained proposals that extend AHP's automation channels. Each proposal stands on its own: it has its own scenarios, a description of today's behavior, and a design, and it can be reviewed, accepted, deferred, or split independently. The discussion draft that prompted them is preserved in #567 for background. You don't need to read it to review anything here.
Why
AHP's automation channels, the catalogue (ahp-automations://) and runs (ahp-automation-run:), are both at stability 1.0 (Early development). They already settle the core architecture:
- one host-owned authority that persists definitions, evaluates triggers, and records runs, so clients never run a fallback copy;
- separate catalogue and run channels;
- runs that link ordinary sessions, which remain authoritative for transcripts, tools, and confirmations;
- portable schedules (five-field cron with an IANA time zone and a misfire policy) and discoverable, host-defined event triggers;
- disable conditions, and customizations the host captures so unattended runs can use them.
The question these proposals answer: can a real automation system be represented over AHP completely, so any AHP client can author, run, observe, and audit it without a private side API? If a host can't express its real behavior, it has to keep a private API next to AHP. Clients then have two sources of truth, and the AHP view becomes a lossy projection, which undermines the single-authority model the channels are built on.
Today the answer is yes for simple scheduled jobs, but not yet for event-driven, long-lived, or unattended agents:
- an event-triggered agent has no portable way to learn which item triggered it;
- every run creates a fresh session, so a long-lived agent that owns one item can't be represented;
- what happens when runs overlap is unspecified and differs between hosts;
- definitions have no version identity, and runs don't record which definition they executed;
- "why didn't it run?" and "what did it do?" have no answer in state;
- whether automatic runs can start while nobody is connected, and what happens when they need a person, is invisible;
- a catalogue can't be scoped at multi-tenant scale.
Already supported
These scenarios fit AHP 1.0 today. No change is proposed.
| Need | AHP construct |
|---|---|
| Recurring schedules | AutomationScheduleTrigger (five-field cron and an IANA time zone) |
| Missed schedules | misfirePolicy (runOnce or skip) |
| External events, including filtered events, derived events ("all required checks finished"), and messages from other agents | AutomationEventTrigger, listAutomationTriggerDefinitions, and configSchema |
| Pause scheduling but keep manual runs | enabled together with the run operation |
| Retry-safe manual runs | runAutomation.requestId |
| Model, reasoning options, and custom agent | session.model (including ModelSelection.config) and session.agent |
| Execution environment or sandbox selection | session.config, described by the host's config schema |
| Stopping a run | automationRun/cancelRequested |
| Retries and parallel workers | AutomationRunState.sessions and primarySession |
| Plugins for unattended runs | session.customizations, captured by the host |
| Time-boxed, count-limited, or one-shot schedules | disableConditions (afterRuns, afterDate) |
How the proposals were shaped
- Native first. Each proposal reuses an existing AHP construct where one fits: message attachments for context delivered with a message; queued pending messages for delivery into a busy chat; the run lifecycle for waiting detail; the changeset
nonceprecondition for definition versions; RFC 6570 channel templates for partitioning;ProjectInfofor grouping; and session and chat read state for runs. - State first. Anything a client needs to render, explain, or safely edit is typed state, not
_metaand not side commands. - Additive, with closed enums kept closed.
AutomationRunStatus,AutomationTriggerKind, andAutomationRunOriginKindare@exhaustiveand don't change. New detail goes into optional fields and@nonexhaustiveenums. - Capabilities only where a client must know before acting. Fields or commands that a client authors, and that an older host would silently ignore, are capability-gated. Optional state the host fills in needs no capability: clients render it when it's present.
- The host boundary holds. There's no prompt templating language, no limits on the agent's loop, and no tool vocabulary.
- No dependencies between proposals. Where proposals touch, the notes describe how they compose, not what one requires from another.
Proposals
| Proposal | What it unlocks | Priority | Size |
|---|---|---|---|
| Run inputs (#569) | Event-triggered agents know which item they're acting on; "run triage on issue 42 now"; event text is treated as data, not instructions | High | S–M |
| Wait reasons and skipped occurrences (#570) | Answers to "why hasn't it started?" and "why didn't it run?" | High | S–M |
| Definition revisions (#571) | Audit and rollback, no silent lost updates, and deterministic run semantics | High | M |
| Continue an existing session (#572) | Long-lived agents: pull request shepherds, repository caretakers, "check on this every hour" in a conversation | High | L |
| Concurrency and coalescing (#573) | Hourly jobs that sometimes take 90 minutes, capacity limits, and bursts of events handled as one run | High | M |
| Unattended runs (#574) | Nightly jobs you can rely on: will it fire, as whom, and what happens if it needs a person | Medium–High | S–M |
| Run results and read state (#575) | Run history you can triage without opening transcripts | Medium | M |
| Scoped catalogues (#576) | Catalogues with thousands of automations shown one project at a time, and dashboards of runs across automations | Medium | M |
| Validate before saving (#577) | Inline validation of host-defined triggers while editing | Medium–Low | S |
| Review-gated changes (#578) | Agents that improve their own automations under review, and governed changes | Low | M |
Run inputs (#569). The host delivers each run's inputs (the trigger occurrence, or input from the person who started the run) as a new kind of message attachment next to the author's unchanged instructions. Normative rules say hosts never splice event content into the message text, present it to the agent as data, and treat people named in events as provenance rather than authority. runAutomation gains optional input, behind a capability.
Wait reasons and skipped occurrences (#570). A pending run can say why it's waiting (capacity, concurrency, quota, authentication, a busy target, retry, or host unavailable) and when it will try again, using the existing lifecycle action. Each automation gains a health summary and counts of occurrences that didn't become runs, grouped by trigger and reason (misfire, overlap, filtered, quota), so the state stays small however many events arrive. No new run statuses are added.
Definition revisions (#571). Each catalogue entry gains an opaque revision token. Updates and manual runs can optionally require an expected revision, following the changeset nonce precedent (a mismatch is rejected or returns Conflict, and omission adds no precondition). Each run records the revision current when it was admitted. An optional paginated history makes rollback an ordinary update.
Continue an existing session (#572). A definition can deliver its runs to a new session (today's behavior), to one existing chat, or to the session it previously created for the same item, using a correlation key that trigger discovery advertises. Delivery is an ordinary queued message, so a run never steers an active turn. Each run records the queued message and turn it owns, its lifecycle follows that turn, and MessageOrigin gains a reference to the delivering run. Manual runs can target a chat, a new session, or a specific item's session.
Concurrency and coalescing (#573). An optional policy sets how many runs may execute at once and whether extra automatic occurrences queue, are skipped, or are coalesced into the waiting run, with an optional batch window so a burst becomes one run. The host publishes the policy it actually applies. A coalesced run records every occurrence it covers, and its agent receives the context of all of them. Manual runs are never skipped or coalesced.
Unattended runs (#574). A capability says whether automatic runs can start while no client is connected. Display identities say whose authority an automation runs as and whom each run acted as. Two optional guardrails can only make runs more limited: how long a run may wait for input, and how long it may run. Tool allow-lists and write scopes stay in the host's session configuration.
Run results and read state (#575). A run's terminal lifecycle can carry a summary, an outcome (changed, noChange, or needsAttention), and output references. Because run summaries mirror the lifecycle, results appear in run history automatically. Runs gain read state that mirrors sessions and chats.
Scoped catalogues (#576). Automations gain a host-owned ProjectInfo (as sessions have) and client-editable tags. Hosts advertise an RFC 6570 template for scoped catalogue channels, so large catalogues are partitioned by URI rather than filtered per subscriber, and a paginated listAutomationRuns gives dashboards an ordered run history across automations.
Validate before saving (#577). A side-effect-free validateAutomation command returns the definition as the host would store it, with field-level errors and warnings and, optionally, the next scheduled occurrences, following the resolveSessionConfig precedent.
Review-gated changes (#578). A definition change can wait on the catalogue entry as a proposed change until someone allowed to review approves or rejects it. New propose and review operations surface who needs review. Agents can propose changes through host tools without blocking their runs.
How they compose
Each scenario below works with the first proposal listed. The others make it better, but aren't required.
| Scenario | Works with | Better with |
|---|---|---|
| "Check on this every hour" in the current conversation | #572 (chat target) | #570 (show that a run is waiting for the conversation), #575 |
| Review every new pull request safely | #569 | #573 (bursts), #575 (results), #574 (limits) |
| Pull request shepherd | #572 (correlated target) | #569 (which event happened), #573 (coalesce a burst of comments into one run), #575 |
| Nightly maintenance job | #574 | #570 (why it didn't run), #573 (overlap) |
| "Which prompt produced last Tuesday's bad pull request?" | #571 | #575 (outputs) |
| Thousands of automations across an organization | #576 | #574 (filter by who an automation runs as) |
Considered and not proposed
- Tool allow-lists, write scopes (branch patterns, repository allowlists), and sandbox selection for unattended runs. These use host-specific vocabularies and belong in the session configuration schema that hosts already publish and clients already render.
- Limits on the agent's loop, such as a maximum number of turns. These are agent implementation details behind the host boundary. The run time limit in Proposal: Predictable unattended automation runs #574 covers the user-visible need.
- Prompt templating. Proposal: Give automation runs their trigger context and manual input as data #569 delivers inputs as data instead.
- Skipped occurrences as runs, with a terminal
skippedstatus. This would widen the@exhaustiverun status. Proposal: Explain why an automation run is waiting or didn't happen #570 records them on the catalogue entry instead. - A standalone schedule preview method. The portable cron rules let clients compute previews themselves, and Proposal: Validate automation definitions before saving #577 can return the host's own preview alongside validation.
- Feeds of every received event. Proposal: Explain why an automation run is waiting or didn't happen #570 keeps counts and reasons instead, and leaves a detailed per-occurrence history as an open question.
Questions that span proposals
- What is a run the unit of? These proposals treat a run as the unit of delivery: one message, possibly carrying several inputs (Proposal: Automation concurrency limits, overlap policy, and coalesced runs #573). For a run with a single delivery, its outcome is the outcome of the turn its message opens, in both fresh and reused sessions (Proposal: Let automation runs continue an existing session #572). Retries and parallel workers remain possible, as they are today.
- Identity. Proposal: Predictable unattended automation runs #574 (runs as, acted as), Proposal: Review-gated automation definition changes #578 (proposed by), and possibly Proposal: Automation definition revisions and run pinning #571 (changed by) all need a display identity. A shared protocol type might be better than one per proposal.
- Structured rejections. Proposal: Automation definition revisions and run pinning #571 and Proposal: Validate automation definitions before saving #577 both run into
rejectionReasonbeing free text.
Suggested order
- Proposal: Give automation runs their trigger context and manual input as data #569, Proposal: Explain why an automation run is waiting or didn't happen #570, Proposal: Automation definition revisions and run pinning #571: small or foundational, and they settle run semantics while the channels are still at 1.0.
- Proposal: Let automation runs continue an existing session #572, Proposal: Automation concurrency limits, overlap policy, and coalesced runs #573: the execution model for long-lived and bursty agents.
- Proposal: Predictable unattended automation runs #574, Proposal: Automation run results and read state #575, Proposal: Scoped automation catalogues, tags, and run history across automations #576.
- Proposal: Validate automation definitions before saving #577, Proposal: Review-gated automation definition changes #578.
Activity
benvillalobos commentedon Nov 24, 2026
Priorities for VS Code right now are to ensure remote / unattended machines are stable and work as expected, followed by ensuring automations report status and what got done.
Therefore the current implementation order is:
I'm unsure what we'd prioritize next from this list, I suspect it will be around debuggability around these unattended automations but we can see as we get there.