Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

refactor: stream long-lived subprocesses through Bun.spawn handles

3 months ago

781741c
Authored
Cursor Agent7/1/2026, 11:03:28 PM
Phase 3 (part 2) of the Bun-native migration. Adds src/utils/subprocess.ts
(spawnStreamingSubprocess + subscribeLines line reader) and migrates the
streaming consumers off node:child_process and node:readline:

- sessionBackup/command.ts: tar/preview capture via Bun.spawn, exit-127
  contract for missing executables preserved
- coworkRuntime/libreOffice.ts: managed soffice probe with SIGKILL timeout
  race and a 4 MiB output cap (previously unbounded)
- webDesktopService.ts: workspace server monitor consumes web-stream line
  subscriptions; graceful SIGTERM-then-SIGKILL escalation kept

Co-authored-by: Max Weinbach <mweinbach@users.noreply.github.com>

Parentd4b21df

5 files changed
  • src/coworkRuntime/libreOffice.ts+40−32
  • src/server/sessionBackup/command.ts+14−40
  • src/server/webDesktopService.ts+39−62
  • src/utils/subprocess.ts+140−0
  • test/webDesktopRoutes.test.ts+52−17