Skip to content

feat(observability): structured termination reason for every run #149

Description

@ZuyiZhou

Problem

When a run ends abnormally, the result payload carries no machine-readable cause. Operators are left doing forensic fingerprinting — e.g. inferring "launch stall" from n_messages == 0 && elapsed ≈ watchdog timeout, or diffing timestamps to separate "gateway rejected the request" from "agent deadlocked internally" from "model stopped making progress".

In batch usage this is the single largest operational cost: for one incident class, roughly half of the debugging time went into merely classifying failures before any actual fixing could start.

Proposal

Every terminated run should emit a structured termination record in the result artifact itself (not only in logs), e.g.:

{
  "finish_reason": "llm_call_timeout",
  "detail": { "last_error": "...", "http_status": 429, "turn": 17 }
}

Suggested enum, minimally:

Design notes:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions