Conversation
…queries Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nd writes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ktree creation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… guidelines Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…s pasted - Backend no longer sends send-keys Enter (frontend owns submission) - Add sendInput() export to Terminal.svelte - Add onfixsuccess callback to CiDetailsDialog, close dialog then send \r after 300ms delay - Flush FileSink after every write() to ensure single-byte input is sent immediately Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Claude finished @centdix's task in 2m 29s —— View job Code Review: Replace blocking Bun.spawnSync with async Bun.spawn
Overall this is a solid PR. The core goal — unblocking the event loop by replacing Issues1. Stream consumption order in
|
|
Claude finished @centdix's task in 2m 22s —— View job Code Review: Replace blocking Bun.spawnSync with async Bun.spawn
Overall: Solid PR. The core goal — removing blocking What's good
Things to flag1. Behavioral change to 2. Magic 300ms delay ( 3. Dangling timeout timer in const controller = new AbortController();
const timeout = Bun.sleep(TMUX_TIMEOUT_MS, { signal: controller.signal }).then(...)
const result = await Promise.race([proc.exited, timeout]);
if (result !== "timeout") controller.abort();Not a bug, just a minor cleanliness improvement. 4. Remaining sync calls are fine — 5. NitpickIn Verdict: The changes are correct and improve the server's responsiveness. The only thing I'd want to see addressed (or explicitly acknowledged) is item #1 — the behavioral change to the send endpoint. |
| const proc = Bun.spawn(args, { stdout: "pipe", stderr: "pipe" }); | ||
| const exitCode = await proc.exited; |
There was a problem hiding this comment.
Bug (low probability): proc.exited is awaited before consuming proc.stdout. If the gh output exceeds the OS pipe buffer (~64KB), the child blocks on write and proc.exited never resolves — classic deadlock.
With --limit 50 this is unlikely in practice, but the pattern in runChecked (workmux.ts:78-81) is safer — read stdout/stderr first, then await exit:
| const proc = Bun.spawn(args, { stdout: "pipe", stderr: "pipe" }); | |
| const exitCode = await proc.exited; | |
| const proc = Bun.spawn(args, { stdout: "pipe", stderr: "pipe" }); | |
| const [stdout, stderr] = await Promise.all([ | |
| new Response(proc.stdout).text(), | |
| new Response(proc.stderr).text(), | |
| ]); | |
| const exitCode = await proc.exited; |
Then update the references below: line 80 → stderr.trim(), line 87 → stdout.
| ciDetailsPr = null; | ||
| // Delay to let tmux finish streaming the paste buffer to the PTY | ||
| // before sending Enter — paste-buffer returns before the PTY write completes. | ||
| setTimeout(() => terminalRef?.sendInput("\r"), 300); |
There was a problem hiding this comment.
Fragile timing: This 300ms is a guess for how long tmux needs to stream the paste buffer to the PTY. On a loaded system or with a large paste payload (CI logs can be up to 30KB), this could be too short. Worth monitoring — if users report the Enter arriving before the paste completes, this will need a different approach (e.g., backend signaling completion, or a longer delay).
|
@claude make the improvement for the fragile frontend timing. make backend return success when task is done, and make frontend wait for that, then have a 200 ms delay still after that to be sure. make 200ms a visible const |
|
Claude finished @centdix's task in 2m 28s —— View job Fixed: visible
|
Backend already awaits paste-buffer completion before returning, frontend already awaits the API response, so 200ms is sufficient as a PTY flush safety buffer (down from 300ms). Co-authored-by: centdix <centdix@users.noreply.github.com>
Summary
Bun.spawnSyncnetwork/slow calls with asyncBun.spawnto prevent event loop stalls--state all) to avoid GitHub GraphQL 504 timeouts on large reposPromise.allBun.spawnSync(["cat"])in env.ts with nativeBun.file().text()(no subprocess)spawnSync(["sleep"])withawait Bun.sleep()sendPromptto fail fast when agent is busysend-keys EnterFileSinkafter everywrite()to ensure single-byte input is sent immediatelyTest plan
.env.local🤖 Generated with Claude Code