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.
Problem
projectTrace()preserves the overall run status ascancelled, but the corresponding run step inFolioTrace.stepsonly mapsfailedandcompleted. A cancelled run therefore getsstatus: "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
Proposed scope
cancelledto the trace step status type.Run.status === "cancelled"when projecting the run timeline step.