From fbb573b62ecca13b162ce6ae6e81f9330b3eee46 Mon Sep 17 00:00:00 2001 From: T3 Code Test Date: Fri, 31 Jul 2026 04:49:28 +0530 Subject: [PATCH] fix(orchestration-v2): leave zero-activation leftovers unseeded in turn ordinals The rehydration seed stored Math.max(1, activationCount) in a map that tracks the last issued ordinal, so a leftover with no recorded activations started its first turn at ordinal 2 and skipped childRootNodeId. Skip seeding those entries so the first turn takes ordinal 1. Co-Authored-By: Claude Fable 5 --- apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts b/apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts index 392f57b6c9..9cc352f1d5 100644 --- a/apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts +++ b/apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts @@ -1616,7 +1616,11 @@ export function makeCodexAdapterV2(adapterOptions: CodexAdapterV2Options): Provi for (const entry of existing) { const key = String(entry.childProviderThread.id); if (updated.has(key)) continue; - updated.set(key, Math.max(1, entry.subagent.activationCount)); + // The map stores the last issued ordinal. A leftover with no + // recorded activations must stay unseeded so its first turn + // takes ordinal 1 and maps onto childRootNodeId. + if (entry.subagent.activationCount <= 0) continue; + updated.set(key, entry.subagent.activationCount); } return updated; });