Skip to content

Commit b320109

Browse files
t3dotggclaude
andcommitted
refactor(server): match payload guard shape in isSettledBinding
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent 67cc937 commit b320109

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

‎apps/server/src/provider/Layers/ProviderService.ts‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -429,13 +429,10 @@ function readPersistedCwd(
429429

430430
/** Stopped rows with no active turn are settled; shutdown leaves them untouched. */
431431
function isSettledBinding(binding: ProviderSessionDirectory.ProviderRuntimeBinding): boolean {
432+
if (binding.status !== "stopped") return false;
432433
const payload = binding.runtimePayload;
433-
const hasActiveTurn =
434-
payload !== null &&
435-
typeof payload === "object" &&
436-
"activeTurnId" in payload &&
437-
payload.activeTurnId != null;
438-
return binding.status === "stopped" && !hasActiveTurn;
434+
if (!payload || typeof payload !== "object" || Array.isArray(payload)) return true;
435+
return !("activeTurnId" in payload) || payload.activeTurnId == null;
439436
}
440437

441438
const dieOnMissingBindingInstanceId = (

0 commit comments

Comments
 (0)