chore: trace reserved turn refresh boundaries

This commit is contained in:
2026-08-05 02:15:33 +00:00
parent f765fe610f
commit 5fda95b25a
2 changed files with 19 additions and 0 deletions
@@ -408,6 +408,17 @@ export class InMemoryReservedTurnStore {
orderBy: [{ turnIdx: 'asc' }],
});
this.generalTurns.set(generalId, buildTurnListFromRows(rows, this.maxGeneralTurns));
if ((process.env.CORE_AI_TRACE_GENERAL_IDS?.split(',') ?? []).includes(String(generalId))) {
process.stdout.write(
`RESERVED_TURN_REFRESH_TRACE ${JSON.stringify({
generalId,
force,
firstAction: rows.find((row) => row.turnIdx === 0)?.actionCode ?? DEFAULT_TURN_ACTION,
dirty: this.dirtyGeneralIds.has(generalId),
leased: this.leasedGeneralIds.has(generalId),
})}\n`
);
}
}
async prefetchGeneralTurns(generalIds: number[]): Promise<void> {