runs: list survives a damaged run record (#1551)
Row 82 round 2, owner Rocko, candidate manifest dbf36e92 on 876f1ffe.
Approved by Filbert (27650); Sage's gate green 02:05-02:09Z.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -470,18 +470,19 @@ function readRuns(read) {
|
||||
function listRuns() {
|
||||
const resolved = loadConfig();
|
||||
for (const { runId, result } of readRuns(() => listRunRecords(resolved.dataRoot))) {
|
||||
// An incomplete or unreadable run record (result null) reports as unknown.
|
||||
// An incomplete or unreadable run record (result null) reports as unknown,
|
||||
// and so does each field of a damaged one that isn't a string.
|
||||
let status = "unknown";
|
||||
let taskId = "-";
|
||||
let workspace = "-";
|
||||
let session = "-";
|
||||
if (result) {
|
||||
status = result.status;
|
||||
taskId = result.taskId;
|
||||
workspace = result.workspace ?? "-";
|
||||
session = result.session ?? "-";
|
||||
if (typeof result.status === "string") status = result.status;
|
||||
if (typeof result.taskId === "string") taskId = result.taskId;
|
||||
if (typeof result.workspace === "string") workspace = result.workspace;
|
||||
if (typeof result.session === "string") session = result.session;
|
||||
}
|
||||
process.stdout.write(`${runId} ${status.padEnd(9)} task=${taskId.padEnd(18)} ws=${String(workspace).padEnd(10)} session=${session}\n`);
|
||||
process.stdout.write(`${runId} ${status.padEnd(9)} task=${taskId.padEnd(18)} ws=${workspace.padEnd(10)} session=${session}\n`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user