From 399796cbe4237a9a18e26fb04be1244ef4c35d1a Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Tue, 17 Mar 2026 17:14:52 +0900 Subject: [PATCH] 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 --- src/openclaw/tmux.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/openclaw/tmux.ts b/src/openclaw/tmux.ts index 663ac040a..6b575e662 100644 --- a/src/openclaw/tmux.ts +++ b/src/openclaw/tmux.ts @@ -17,6 +17,7 @@ export async function getTmuxSessionName(): Promise { 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 {