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