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 <[email protected]>
This commit is contained in:
T3 Code TestandClaude Fable 5 committed 2026-08-14 15:04:12 +05:30
1 parent 289c000a57
commit fbb573b62e
1 file changed
+5 -1
@@ -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;
});