Skip to content

Commit 5f1a1fb

Browse files
Theaxiomclaude
andcommitted
feat(sdk): add optional summary field to execution-summary types
Add `summary?: string | null` to `ExecutionSummary` and `WorkflowExecutionSummary` so consumers can read the new agent/workflow summary field emitted by the orchestrator (execution_summary endpoints). Optional + nullable for forward compatibility with orchestrators that have not yet rolled out the field. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f7ce602 commit 5f1a1fb

2 files changed

Lines changed: 71 additions & 0 deletions

File tree

src/__tests__/types.test.ts

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// SPDX-License-Identifier: AGPL-3.0-only
2+
// Copyright 2026 100monkeys.ai
3+
4+
import { ExecutionSummary, WorkflowExecutionSummary } from "../types";
5+
6+
describe("ExecutionSummary summary field", () => {
7+
test("ExecutionSummary accepts summary field", () => {
8+
const e: ExecutionSummary = {
9+
id: "x",
10+
status: "completed",
11+
started_at: "2026-01-01T00:00:00Z",
12+
summary: "hi",
13+
};
14+
expect(e.summary).toBe("hi");
15+
});
16+
17+
test("ExecutionSummary accepts null summary", () => {
18+
const e: ExecutionSummary = {
19+
id: "x",
20+
status: "completed",
21+
started_at: "2026-01-01T00:00:00Z",
22+
summary: null,
23+
};
24+
expect(e.summary).toBeNull();
25+
});
26+
27+
test("ExecutionSummary accepts omitted summary", () => {
28+
const e: ExecutionSummary = {
29+
id: "x",
30+
status: "completed",
31+
started_at: "2026-01-01T00:00:00Z",
32+
};
33+
expect(e.summary).toBeUndefined();
34+
});
35+
});
36+
37+
describe("WorkflowExecutionSummary summary field", () => {
38+
test("WorkflowExecutionSummary accepts summary field", () => {
39+
const w: WorkflowExecutionSummary = {
40+
id: "x",
41+
workflow_name: "wf",
42+
status: "completed",
43+
started_at: "2026-01-01T00:00:00Z",
44+
summary: "hi",
45+
};
46+
expect(w.summary).toBe("hi");
47+
});
48+
49+
test("WorkflowExecutionSummary accepts null summary", () => {
50+
const w: WorkflowExecutionSummary = {
51+
id: "x",
52+
workflow_name: "wf",
53+
status: "completed",
54+
started_at: "2026-01-01T00:00:00Z",
55+
summary: null,
56+
};
57+
expect(w.summary).toBeNull();
58+
});
59+
60+
test("WorkflowExecutionSummary accepts omitted summary", () => {
61+
const w: WorkflowExecutionSummary = {
62+
id: "x",
63+
workflow_name: "wf",
64+
status: "completed",
65+
started_at: "2026-01-01T00:00:00Z",
66+
};
67+
expect(w.summary).toBeUndefined();
68+
});
69+
});

src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export interface ExecutionSummary {
2727
status: string;
2828
started_at: string;
2929
ended_at?: string;
30+
summary?: string | null;
3031
}
3132

3233
export interface ExecutionDetail extends ExecutionSummary {
@@ -149,6 +150,7 @@ export interface WorkflowExecutionSummary {
149150
started_at: string;
150151
ended_at?: string;
151152
current_state?: string;
153+
summary?: string | null;
152154
}
153155

154156
export interface WorkflowExecutionListResponse {

0 commit comments

Comments
 (0)