diff --git a/src/main/database/runs.ts b/src/main/database/runs.ts index 6a1a6986..382bee02 100644 --- a/src/main/database/runs.ts +++ b/src/main/database/runs.ts @@ -128,13 +128,13 @@ export function buildRunMethods( } }, - markRunStatus(runId: string, status: RunRecord["status"], message: string) { + markRunStatus(runId: string, status: RunRecord["status"], message: string | null) { const ts = nowIso(); const startedAt = status === "running" ? ts : null; transaction(() => { getDb() .prepare( - "update runs set status = ?, summary = case when ? != '' then ? else summary end, started_at = coalesce(started_at, ?), updated_at = ? where id = ?", + "update runs set status = ?, summary = case when ? is not null then ? else summary end, started_at = coalesce(started_at, ?), updated_at = ? where id = ?", ) .run(status, message, message, startedAt, ts, runId); diff --git a/src/main/database/snapshot.ts b/src/main/database/snapshot.ts index 753885ab..6d06e662 100644 --- a/src/main/database/snapshot.ts +++ b/src/main/database/snapshot.ts @@ -186,11 +186,9 @@ export function buildSnapshotMethods( listRendererSnapshot(): ProfileSnapshot { const currentCompanyId = deps.getCurrentCompanyId(); - if (!currentCompanyId) { - return listSnapshot(); - } - const snapshot = listSnapshot({ companyId: currentCompanyId }); - return snapshot; + return currentCompanyId + ? listSnapshot({ companyId: currentCompanyId }) + : listSnapshot(); }, }; } diff --git a/src/main/desktop-shell-menu.ts b/src/main/desktop-shell-menu.ts index 9e4de115..48d1ffdc 100644 --- a/src/main/desktop-shell-menu.ts +++ b/src/main/desktop-shell-menu.ts @@ -121,7 +121,12 @@ export function createDesktopShellMenu(deps: DesktopShellMenuDependencies) { click: () => onShortcut("refresh"), }, { type: "separator" }, - { role: "toggleDevTools", visible: isDev }, + { + role: "toggleDevTools", + // Hidden in packaged builds unless opted in via env var so power + // users can still inspect rendered state without a dev build. + visible: isDev || process.env.AGENTCOMPANY_ENABLE_DEVTOOLS === "true", + }, ], }, {