Skip to content

Commit 1bac10a

Browse files
committed
Merge branch 'codex/fix-conversation-recovery-null-20261021' into codex/ts-todo-read-20261019
Signed-off-by: aihop <4408344+hhyykk@users.noreply.github.com>
2 parents 7e7a631 + af00738 commit 1bac10a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎loopx/control_plane/collaboration/conversation_binding.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ function planContextRecovery(params: JsonObject, row: JsonObject, current: JsonO
496496
|| !["context_window_exceeded", "host_gate", "upstream_transport_failure", "server_overloaded"].includes(String(failed.error_code))
497497
|| typeof failed.upstream_turn_id !== "string" || !failed.upstream_turn_id) return no;
498498
const previous = row.context_recovery == null ? null : requireJsonObject(row.context_recovery, "reserved context recovery");
499-
if (recovery.admitted_turn != null && previous?.failed_turn_id === failed.turn_id
499+
if (recovery.admitted_turn != null && previous !== null && previous.failed_turn_id === failed.turn_id
500500
&& Number.isSafeInteger(previous.routing_attempt) && Number(previous.routing_attempt) >= 1
501501
&& Number(previous.routing_attempt) <= 3 && previous.version === version) {
502502
// A crash after queue admission must adopt that exact canonical Turn,
@@ -560,7 +560,7 @@ function planRoutingRecovery(recovery: JsonObject, row: JsonObject, current: Jso
560560
failed: JsonObject, previous: JsonObject | null, version: number): JsonObject | null {
561561
if (!["host_gate", "upstream_transport_failure"].includes(String(failed.error_code))) return null;
562562
// An unfinished older reservation must finish under its original identity.
563-
if (previous?.failed_turn_id === failed.turn_id && previous.routing_attempt === undefined) return null;
563+
if (previous !== null && previous.failed_turn_id === failed.turn_id && previous.routing_attempt === undefined) return null;
564564
const observed = recovery.native_observation == null ? null
565565
: requireJsonObject(recovery.native_observation, "native failure readback");
566566
if (observed && observed.pre_execution_routing_timeout !== true) return null;

0 commit comments

Comments
 (0)