* Per-process state-file temp path. The state-file write pattern is * `writeFileSync(tmp, ...) → renameSync(tmp, stateFile)` for atomicity, * but a shared `${stateFile}.tmp` filename means two concurrent writers * (cold-start race when N CLIs hit a fresh repo simultaneously, parallel * /tunnel/s
()
| 557 | * concurrent writers no longer kill each other on the rename. |
| 558 | */ |
| 559 | function tmpStatePath(): string { |
| 560 | return `${config.stateFile}.tmp.${process.pid}.${crypto.randomBytes(4).toString('hex')}`; |
| 561 | } |
| 562 | |
| 563 | |
| 564 | // ─── Sidebar agent / chat state ripped ────────────────────────────── |
no outgoing calls
no test coverage detected