refactor(orchestration): drop a cast from the owed-stop settle check

This commit is contained in:
Jinwoo-H
2026-11-09 03:28:41 -05:00
parent 54d2c21677
commit da6726c3d7
@@ -193,10 +193,10 @@ async function sendFederatedStop(
const stillUnknown = (reason: string, stage?: 'stop_owed' | 'stop_outcome_unknown') =>
fenced(() => {
const now = db.getWorkerDispatch(dispatchId)
return now?.state === 'stopped' ||
const keep =
now?.state === 'stopped' ||
(attempt.resend && stage === 'stop_owed' && now?.stage === 'stop_owed')
? (now as { state: string; last_error: string | null })
: db.markWorkerStopUnknown(dispatchId, reason, stage)
return now && keep ? now : db.markWorkerStopUnknown(dispatchId, reason, stage)
})
try {
const status = RemoteCapabilities.parse(await call('status.get'))