fix(types): add null checks for optional sessionID and startedAt fields

This commit is contained in:
justsisyphus
2026-01-19 10:35:47 +09:00
parent ebaab5aa60
commit c6fb0c701b
3 changed files with 59 additions and 25 deletions
+3 -1
View File
@@ -55,7 +55,9 @@ export function createBackgroundCompactionHook(manager: BackgroundManager) {
sections.push("## Running Background Tasks")
sections.push("")
for (const t of running) {
const elapsed = Math.floor((Date.now() - t.startedAt.getTime()) / 1000)
const elapsed = t.startedAt
? Math.floor((Date.now() - t.startedAt.getTime()) / 1000)
: 0
sections.push(`- **\`${t.id}\`** (${t.agent}): ${t.description} [${elapsed}s elapsed]`)
}
sections.push("")