()
| 60 | * and records turn_start. Call this at the beginning of each user message processing. |
| 61 | */ |
| 62 | export function headlessProfilerStartTurn(): void { |
| 63 | // Only profile in headless/non-interactive mode |
| 64 | if (!getIsNonInteractiveSession()) return |
| 65 | // Only profile if enabled |
| 66 | if (!SHOULD_PROFILE) return |
| 67 | |
| 68 | currentTurnNumber++ |
| 69 | clearHeadlessMarks() |
| 70 | |
| 71 | const perf = getPerformance() |
| 72 | perf.mark(`${MARK_PREFIX}turn_start`) |
| 73 | |
| 74 | if (DETAILED_PROFILING) { |
| 75 | logForDebugging(`[headlessProfiler] Started turn ${currentTurnNumber}`) |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * Record a checkpoint with the given name. |
no test coverage detected