diff --git a/src/commands/openclawcode.test.ts b/src/commands/openclawcode.test.ts index 618044fe31..dfe1ba657c 100644 --- a/src/commands/openclawcode.test.ts +++ b/src/commands/openclawcode.test.ts @@ -777,7 +777,7 @@ describe("openclawCodeRunCommand", () => { expect(payload.runAgeSeconds).toBeNull(); }); - it("prints runHasUpdatedAt as false when the workflow update signal is present but empty", async () => { + it("prints runHasUpdatedAt as false and runUpdatedAt as null when the workflow update signal is present but empty", async () => { mocks.runIssueWorkflow.mockResolvedValue( createRun({ updatedAt: [] as unknown as WorkflowRun["updatedAt"], @@ -787,7 +787,7 @@ describe("openclawCodeRunCommand", () => { await openclawCodeRunCommand({ issue: "2", repoRoot: "/repo", json: true }, runtime); const payload = JSON.parse(runtime.log.mock.calls[0]?.[0] ?? "null"); - expect(payload.runUpdatedAt).toEqual([]); + expect(payload.runUpdatedAt).toBeNull(); expect(payload.runHasUpdatedAt).toBe(false); expect(payload.runAgeSeconds).toBeNull(); }); diff --git a/src/commands/openclawcode.ts b/src/commands/openclawcode.ts index 70999dfed2..6f654049d5 100644 --- a/src/commands/openclawcode.ts +++ b/src/commands/openclawcode.ts @@ -1984,7 +1984,7 @@ function toWorkflowRunJson(run: WorkflowRun) { ...run, contractVersion: OPENCLAWCODE_RUN_JSON_CONTRACT_VERSION, runCreatedAt: run.createdAt ?? null, - runUpdatedAt: run.updatedAt ?? null, + runUpdatedAt: typeof run.updatedAt === "string" ? run.updatedAt : null, runHasUpdatedAt, runAgeSeconds: resolveElapsedSeconds(run.createdAt, run.updatedAt), issueNumber: run.issue.number ?? null,