Skip to content

Tracking: automation proposals for event-driven, long-lived, and unattended agents #568

Open
1 of 10 issues completed

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 nonce precondition for definition versions; RFC 6570 channel templates for partitioning; ProjectInfo for 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 _meta and not side commands.
  • Additive, with closed enums kept closed. AutomationRunStatus, AutomationTriggerKind, and AutomationRunOriginKind are @exhaustive and don't change. New detail goes into optional fields and @nonexhaustive enums.
  • 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

Questions that span proposals

Suggested order

  1. 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.
  2. 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.
  3. 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.
  4. Proposal: Validate automation definitions before saving #577, Proposal: Review-gated automation definition changes #578.

Sub-issues

Sub-issues

1 of 10 Issues completed
Loading 10 sub-issues

Activity

  1. benvillalobos commented on Nov 24, 2026

    @benvillalobos
    Member

    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:

    1. Proposal: Predictable unattended automation runs #574, currently being investigated here https://github.com/microsoft/vscode-internalbacklog/issues/10912
    2. Proposal: Automation run results and read state #575

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions