* Register a shutdown cleanup handler so the lock is released even if * turn-end cleanup is never reached (e.g. the user runs /exit while * a tool call is in progress).
()
| 92 | * a tool call is in progress). |
| 93 | */ |
| 94 | function registerLockCleanup(): void { |
| 95 | unregisterCleanup?.() |
| 96 | unregisterCleanup = registerCleanup(async () => { |
| 97 | await releaseComputerUseLock() |
| 98 | }) |
| 99 | } |
| 100 | |
| 101 | /** |
| 102 | * Check lock state without acquiring. Used for `request_access` / |
no test coverage detected