Skip to content

Proposal: Automation run results and read state #575

Open

Description

Tracked in #568. This proposal stands on its own and doesn't depend on the others tracked there.

Summary

Run history shows when a run happened and whether it succeeded, but not what it did. People want to see "opened pull request 123", "commented on 4 issues", or "nothing to do" without opening a transcript. They also want to clear a failed run's badge once they've looked at it, on every device.

This proposal adds an optional result (summary, outcome, and outputs) to a run's terminal lifecycle, and read state for runs that works like the read state for sessions and chats.

Scenarios

  • Run history at a glance. "Opened pull request 123." "Commented on 4 issues." "Nothing to do."
  • Changed or not. Clients separate runs that changed something from runs that found no work, for example by dimming no-op runs.
  • Needs attention. The agent finished but flagged something a person has to look at.
  • Downstream use. Dashboards and other tools consume what each run produced.
  • Clearing badges. Failed runs drive an attention badge. After reviewing a failure on one device, the badge clears on all of them, and history isn't deleted.

AHP today

  • The completed lifecycle carries only usage, the failed lifecycle carries error, and the cancelled lifecycle carries timestamps.
  • What a run produced exists only inside its linked sessions' transcripts. Hosts publish session-level references to pull requests and similar items through private _meta conventions. RFC RFC: Session artifacts #507 proposes typed session artifacts for that.
  • Sessions and chats have read state (SessionStatus.IsRead, session/isReadChanged, chat/isReadChanged). Runs don't, and a run that fails before creating a session has nothing that can be marked read.

Proposal

  1. Result. The completed, failed, and cancelled lifecycles gain optional result: { summary?, outcome?, outputs? }. A run that failed or was cancelled can still have produced outputs, such as a draft pull request. AutomationRunSummary.lifecycle already mirrors the run's full lifecycle, so results appear in catalogue run history without any extra fields.
  2. Outcome. outcome is @nonexhaustive: changed, noChange, or needsAttention.
  3. Outputs. Outputs are resource references, each with a label and an optional displayKind hint such as pullRequest, issue, or comment. This is the vocabulary attachments already use (ContentRef, label, displayKind). Hosts keep the list short and may summarize.
  4. The host writes results. Agents often report results through a host-provided tool, but that's a host detail. An output an agent reports is a claim, not proof. Hosts SHOULD verify outputs they can check (for example, that the pull request exists) and MAY drop outputs they can't verify.
  5. Read state. Runs and their summaries gain isRead, and clients can dispatch automationRun/isReadChanged { isRead }, mirroring session/isReadChanged and chat/isReadChanged. The host sets isRead to false when the run reaches a terminal lifecycle, and again if its result changes after that, so viewing a run while it's still running never hides a later failure. Clients set it to true when a user views the run. A run's read state is independent of the read state of its sessions and chats. Clients decide what drives a badge, such as unread failed runs or unread runs that need attention.

Sketch

Names and shapes are illustrative. The implementation PR settles them.

interface AutomationRunResult {
  /** One line, human-readable, for example "Opened pull request 123". */
  summary?: string;
  outcome?: AutomationRunOutcome;
  outputs?: AutomationRunOutput[];
}

/** @nonexhaustive */
const enum AutomationRunOutcome {
  Changed = 'changed',
  NoChange = 'noChange',
  NeedsAttention = 'needsAttention',
}

/** A resource the run created or changed. */
interface AutomationRunOutput extends ContentRef {
  label: string;
  /** Advisory display hint, as on MessageAttachmentBase.displayKind. */
  displayKind?: string;
}

interface AutomationCompletedRunLifecycle {
  // ...existing fields
  result?: AutomationRunResult;
}

interface AutomationFailedRunLifecycle {
  // ...existing fields
  result?: AutomationRunResult;
}

interface AutomationCancelledRunLifecycle {
  // ...existing fields
  result?: AutomationRunResult;
}

interface AutomationRunState {
  // ...existing fields
  isRead?: boolean;
}

interface AutomationRunSummary {
  // ...existing fields
  isRead?: boolean;
}

/** @clientDispatchable, on the run's ahp-automation-run: channel */
interface AutomationRunIsReadChangedAction {
  type: 'automationRun/isReadChanged';
  isRead: boolean;
}

Why this shape

  • Results belong to the run. A session can serve more than one run, so session-level references can't say which run produced what. The run already owns task-level lifecycle and provenance.
  • Inside the terminal lifecycle. What a run did sits next to how it ended, and it appears in run history automatically because summaries mirror the lifecycle.
  • Existing vocabulary. Outputs use the same resource-reference and display-hint fields as attachments. Read state copies the session and chat pattern exactly.
  • Claims, not proof. Saying who may assert an output, and that hosts verify where they can, keeps run history trustworthy without defining agent tools.

Relationship to RFC #507 (session artifacts)

The two are complementary. #507 describes what a session is about and has produced over its lifetime. A run result describes what one run produced. Their shapes should match. If #507 lands first, run outputs can reuse its resource-artifact type, and hosts can derive a run's outputs from the artifacts its turns created.

Compatibility

  • Additive and optional state. No capability is needed to read results.
  • Clients dispatch automationRun/isReadChanged only on runs whose state includes isRead, which tells them the host tracks read state.

Out of scope

  • The agent-facing tool for reporting results.
  • Protocols for verifying outputs.
  • Chaining automations from another automation's outputs. That's a host-defined event trigger.

Open questions

  1. Should runs with outcome noChange start as read?
  2. On hosts with many users, should read state be per user rather than shared, as it is for sessions and chats today?
  3. Should verified outputs be marked explicitly?
  4. Should the run summary carry only summary and outcome, and leave outputs to the run channel to keep the catalogue small?

Related proposals (none required)

Activity

  1. added
    feature-request
    on Nov 6, 2026
  2. benvillalobos commented on Nov 16, 2026

    @benvillalobos
    Member

    I'd like to prioritize this as there is a need for exposing the result of an automation to users and is frequently requested. Some thoughts:

    • Why 'Changed', 'noChange', ''NeedsAttention"?

    I've been seeing this as either "Needs attention" or "can be ignored", would a client display anything meaningfully different between 'changed' and 'noChange', or should this be derived by the summary?

    The host writes results. Agents often report results through a host-provided tool, but that's a host detail. An output an agent reports is a claim, not proof. Hosts SHOULD verify outputs they can check (for example, that the pull request exists) and MAY drop outputs they can't verify.

    I wonder how much of this should be on the host vs. the client to reason about. I'm not sure if this is crossing some kind of "how much work should be offloaded to the host" boundary, but my gut response to seeing that is that clients would still need to validate what they are displaying cc Connor Peet (@connor4312)

  3. benvillalobos commented on Nov 17, 2026

    @benvillalobos
    Member

    I could see a use case for adding Success to AutomationRunOutcome.

    I'm still not fully convinced on the difference between "did something" (changed) and "did not do something" (nochange), but "completed the intended task successfully" vs. "there was nothing to do" seems like a meaningful distiction I would want in vs code (eg. kick the tires on flaky CI in any PR's I have open right now, or triage new issues that were assigned to me).

    Perhaps changed means success in this scenario, and any changed outcome is technically a success, but would love other perspectives here

  4. connor4312 commented on Nov 17, 2026

    @connor4312
    Member

    I'm okay with the general direction, though as Ben says I'm very suspicious of the shape of AutomationRunOutcome. I have automations that process GitHub notifications. These can interact with the notifications, but should that be expressed as them making a change or not? And as a user how does that matter for my experience?

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

Metadata

Metadata

Labels

feature-request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions