Skip to content

[Trace] Cancelled Agent runs are rendered as running in the timeline #199

Description

@Guo-Yixin

Problem

projectTrace() preserves the overall run status as cancelled, but the corresponding run step in FolioTrace.steps only maps failed and completed. A cancelled run therefore gets status: "running" in the timeline.

This makes the trace contain contradictory observability data: the trace header says cancelled while the run step still appears active.

Expected behavior

A cancelled run should produce a run timeline step with status: "cancelled".

Reproduction

const trace = projectTrace({
  run: {
    id: 'r-cancel',
    sessionId: 's',
    status: 'cancelled',
    input: 'run',
    startedAt: 1,
    completedAt: 2,
  },
  messages: [],
});

trace.status === 'cancelled';
trace.steps.find((step) => step.kind === 'run')?.status === 'running'; // current behavior

Proposed scope

  • Add cancelled to the trace step status type.
  • Preserve Run.status === "cancelled" when projecting the run timeline step.
  • Add a regression test.

Activity

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

Metadata

Metadata

Assignees

Labels

claimedClaimed by a contributor and currently in progress

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions