























@@ -123,7 +123,7 @@ describe("flows commands", () => {
123123updatedAt: 100,
124124});
125125126-createRunningTaskRun({
126+const task = createRunningTaskRun({
127127runtime: "subagent",
128128ownerKey: "agent:main:main",
129129scopeKind: "session",
@@ -139,26 +139,22 @@ describe("flows commands", () => {
139139const runtime = createRuntime();
140140await flowsShowCommand({ lookup: flow.flowId, json: false }, runtime);
141141142-const output = vi
143-.mocked(runtime.log)
144-.mock.calls.map(([line]) => String(line))
145-.join("\n");
146-expect(output).toContain("TaskFlow:");
147-expect(output).toContain(`flowId: ${flow.flowId}`);
148-expect(output).toContain("status: blocked");
149-expect(output).toContain("goal: Investigate a flaky queue");
150-expect(output).toContain("currentStep: spawn_child");
151-expect(output).toContain("owner: agent:main:main");
152-expect(output).toContain("state: Waiting on child task output");
153-expect(output).toContain("Linked tasks:");
154-expect(output).toContain("run-child-2");
155-expect(output).toContain("Collect logs");
156-expect(output).not.toContain("syncMode:");
157-expect(output).not.toContain("controllerId:");
158-expect(output).not.toContain("revision:");
159-expect(output).not.toContain("blockedTaskId:");
160-expect(output).not.toContain("blockedSummary:");
161-expect(output).not.toContain("wait:");
142+expect(vi.mocked(runtime.log).mock.calls.map(([line]) => String(line))).toEqual([
143+"TaskFlow:",
144+`flowId: ${flow.flowId}`,
145+"status: blocked",
146+"goal: Investigate a flaky queue",
147+"currentStep: spawn_child",
148+"owner: agent:main:main",
149+"notify: done_only",
150+"state: Waiting on child task output",
151+"createdAt: 1970-01-01T00:00:00.100Z",
152+"updatedAt: 1970-01-01T00:00:00.100Z",
153+"endedAt: n/a",
154+"tasks: 1 total · 1 active · 0 issues",
155+"Linked tasks:",
156+`- ${task.taskId} running run-child-2 Collect logs`,
157+]);
162158});
163159});
164160@@ -176,7 +172,7 @@ describe("flows commands", () => {
176172updatedAt: 100,
177173});
178174179-createRunningTaskRun({
175+const task = createRunningTaskRun({
180176runtime: "subagent",
181177ownerKey: unsafeOwnerKey,
182178scopeKind: "session",
@@ -193,13 +189,22 @@ describe("flows commands", () => {
193189await flowsShowCommand({ lookup: flow.flowId, json: false }, runtime);
194190195191const lines = vi.mocked(runtime.log).mock.calls.map(([line]) => String(line));
196-expect(lines).toContain("goal: Investigate\\nqueue\\tstate");
197-expect(lines).toContain("currentStep: spawn_child");
198-expect(lines).toContain("owner: agent:main:owner");
199-expect(lines).toContain("state: Waiting on child\\nforged: yes");
200-expect(
201-lines.some((line) => line.includes("run-child-3") && line.includes("Collect\\nlogs")),
202-).toBe(true);
192+expect(lines).toEqual([
193+"TaskFlow:",
194+`flowId: ${flow.flowId}`,
195+"status: blocked",
196+"goal: Investigate\\nqueue\\tstate",
197+"currentStep: spawn_child",
198+"owner: agent:main:owner",
199+"notify: done_only",
200+"state: Waiting on child\\nforged: yes",
201+"createdAt: 1970-01-01T00:00:00.100Z",
202+"updatedAt: 1970-01-01T00:00:00.100Z",
203+"endedAt: n/a",
204+"tasks: 1 total · 1 active · 0 issues",
205+"Linked tasks:",
206+`- ${task.taskId} running run-child-3 Collect\\nlogs`,
207+]);
203208expect(lines.join("\n")).not.toContain("\u001b[");
204209});
205210});
@@ -220,9 +225,9 @@ describe("flows commands", () => {
220225221226expect(vi.mocked(runtime.error)).not.toHaveBeenCalled();
222227expect(vi.mocked(runtime.exit)).not.toHaveBeenCalled();
223-expect(String(vi.mocked(runtime.log).mock.calls[0]?.[0])).toContain("Cancelled");
224-expect(String(vi.mocked(runtime.log).mock.calls[0]?.[0])).toContain(flow.flowId);
225-expect(String(vi.mocked(runtime.log).mock.calls[0]?.[0])).toContain("cancelled");
228+expect(vi.mocked(runtime.log).mock.calls.map(([line]) => String(line))).toEqual([
229+ `Cancelled ${flow.flowId} (managed) with status cancelled.`,
230+]);
226231});
227232});
228233});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。