(runID uuid.UUID)
| 143 | } |
| 144 | |
| 145 | func nextStepNumber(runID uuid.UUID) int32 { |
| 146 | val, _ := stepCounters.LoadOrStore(runID, &atomic.Int32{}) |
| 147 | counter, ok := val.(*atomic.Int32) |
| 148 | if !ok { |
| 149 | panic("chatdebug: invalid step counter type") |
| 150 | } |
| 151 | return counter.Add(1) |
| 152 | } |
| 153 | |
| 154 | // CleanupStepCounter removes per-run step counter and reference count |
| 155 | // state. This is used by tests and later stacked branches that have a |