fix(openclaw): add comment clarifying proc.exited race condition avoidance

cubic identified potential race condition where Bun's proc.exitCode
may be null immediately after stdout closes. Added clarifying
comment that await proc.exited ensures exitCode is set before
checking.

fixes: cubic review on PR #2620
This commit is contained in:
YeonGyu-Kim
2026-03-17 17:14:52 +09:00
parent 77c3ed1a1f
commit 399796cbe4

View File

@@ -17,6 +17,7 @@ export async function getTmuxSessionName(): Promise<string | null> {
const outputPromise = new Response(proc.stdout).text()
await proc.exited
const output = await outputPromise
// Await proc.exited ensures exitCode is set; avoid race condition
if (proc.exitCode !== 0) return null
return output.trim() || null
} catch {