Archilyzer · Source

archilyzer

Archilyzer
git clone https://archilyzer.pages.dev/source/archilyzer.git
Log | Files | Refs | README | LICENSE

commit 8d12e1a8ea5f6b71b10694df27f89bbe953ede23
parent be3eeddeaabe6362b7e58c61bc0a7730aeed734e
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Mon, 12 Oct 2026 16:48:09 -0400

umtool /drafts: a local run has no cost — no null usd (the page crashed on toFixed)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Diffstat:
Mumtool/components/drafts/DraftsPanel.tsx | 2+-
Mumtool/lib/drafts.ts | 3++-
2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/umtool/components/drafts/DraftsPanel.tsx b/umtool/components/drafts/DraftsPanel.tsx @@ -301,7 +301,7 @@ export default function DraftsPanel() { <span className="text-[12px] text-[var(--color-dim)]"> {r.kind && r.kind !== "sweep" ? `${r.kind} of ${r.parent} · ` : ""} {r.model} · {r.channels} - {r.usd !== undefined ? ` · ~$${r.usd.toFixed(2)}` : ""} + {typeof r.usd === "number" ? ` · ~$${r.usd.toFixed(2)}` : ""} </span> {r.currentArticle && <span className="rounded bg-emerald-700/40 px-1 text-[11px]">current article</span>} {r.currentVideo && <span className="rounded bg-sky-700/40 px-1 text-[11px]">current video</span>} diff --git a/umtool/lib/drafts.ts b/umtool/lib/drafts.ts @@ -87,7 +87,8 @@ export function listRuns(): RunView[] { let usd: number | undefined; for (const f of ["run.json", "revise.json"]) { try { - usd = (usd ?? 0) + JSON.parse(readFileSync(path.join(dir, f), "utf8")).usd_estimate; + const v = JSON.parse(readFileSync(path.join(dir, f), "utf8")).usd_estimate; + if (typeof v === "number" && Number.isFinite(v)) usd = (usd ?? 0) + v; // a local run has no cost } catch {} } out.push({