BOLT-1286: Always write TerminatedConnectionLog on connection termination
completedAgent: richie-engineer
Priority: 2
Branch:
winston/connect-always-write-terminated-logPR: #12309
Linear: BOLT-1286
Follow-up from 2026-06-15 Tesla disconnect investigation. terminatedConnectionLog.create blew up because BullMQ job.toJSON() includes a function (toKey) which Prisma cant serialize, swallowing the audit row. Fix: sanitize logContext + fallback minimal log if rich write fails. Branch winston/connect-always-write-terminated-log. Slack thread 1781563452.531189.
Event Timeline
created
failed
lease expired — re-queued for retry
in_progress → queued
status_change
queued → in_progress
subagent_spawned
spawn claim: addressing 2 cursor bugbot threads on PR 12309
failed
lease expired — re-queued for retry
in_progress → queued
status_change
queued → in_progress
failed
lease expired — max retries reached, marking failed (poison pill)
in_progress → failed
progress
Fixed both Cursor bugbot findings. Commit ef35a5e2 pushed. Both cursor review threads already resolved by prior commit 8a6972cf. CI checks started (pending).
subagent_completed
subagent done: cursor bugbot fixes pushed (ef35a5e2 on top of 8a6972cf); both threads resolved; CI pending
status_change
failed → in_progress
subagent_completed
subagent done: shipped ef35a5e2 cursor-bugbot fixes; new cursor finding (orphan audit row on tx-fail) needs follow-up
subagent_spawned
spawn claim: address cursor orphan-audit-row finding on PR 12309
subagent_completed
subagent done: killed before doing work — Richie was already asked the pre-write vs post-write architectural question at Slack ts 1781619717.307219, awaiting decision before acting
failed
lease expired — max retries reached, marking failed (poison pill)
in_progress → failed
status_change
failed → in_progress
failed
lease expired — max retries reached, marking failed (poison pill)
in_progress → failed
status_change
failed → in_progress
failed
lease expired — max retries reached, marking failed (poison pill)
in_progress → failed
status_change
failed → in_progress
failed
lease expired — max retries reached, marking failed (poison pill)
in_progress → failed
status_change
failed → in_progress
failed
lease expired — max retries reached, marking failed (poison pill)
in_progress → failed
subagent_spawned
spawn claim: address PR #12309 cursor Medium: orphan audit row on expire failure
status_change
failed → in_progress
subagent_completed
subagent done: shipped 1081c07251: audit-log inside lock+expire tx; 9/9 tests pass
failed
lease expired — max retries reached, marking failed (poison pill)
in_progress → failed
status_change
failed → in_progress
subagent_spawned
spawn claim: PR-12309-fix-advisory-lock-ordering
failed
lease expired — max retries reached, marking failed (poison pill)
in_progress → failed
status_change
failed → in_progress
failed
lease expired — max retries reached, marking failed (poison pill)
in_progress → failed
subagent_completed
subagent done: advisory-lock ordering fix shipped at ac9965c3 (parallel subagent claim — verifying state); audit + lock now first inside tx
status_change
failed → in_progress
status_change
in_progress → completed