Third patch release. Focus: agents can now inspect and control their background tasks, exit codes flow through the bridge, and claude orphan processes from race conditions are eliminated.
Added
- Exit-code aware bg task tracking. New columns
exit_code,exit_signal,exit_file,is_service(migration 045). The bookkeeper wraps the user command so the exit code survives. A[bg:service]tag in the tool'sdescriptionmarks long-lived servers — when they die, the agent gets[BG_SERVICE_DIED]instead of[BG_COMPLETED]. Non-zero exits routed as[BG_FAILED]. - 5 agent introspection tools:
list_bg_tasks(compact list, running first, status counts),bg_task_detail(full info),get_bg_task_log(read output withtail/head/grepmodes, 64KB cap),kill_bg_task(SIGTERM→SIGKILL escalation),register_external_bg(track a process detached by external scripts likestart.sh). - Global
GET /api/bg-tasksendpoint joiningagentsfor cross-agent visibility. - Activity page split. CLI events and Background Tasks each have their own scrollable section with running-first sort, status badges, elapsed timer, service marker, and 15s auto-refresh. All strings i18n'd.
start.shconvention. The prompt asks the lead to print each spawned service asSERVICE <name> PID=<pid> PORT=<port>and to register them withregister_external_bg.
Fixed
- Orphaned
claudeprocesses from bg-task DB write races. Fire-and-forget DB writes are now serialised vialib/bg-write-tracker.js; the close handler awaits all writes beforemarkOrphanedBgTasksDead. 5 Vitest cases. (Contributed by @AyonPal in #20.) pauseandinterveneleft hung children reparented to init. Both endpoints now escalate SIGTERM → SIGKILL after the grace window. (Contributed by @AyonPal in #20.)- Bookkeeper wrap broke on Python
f'...'and nested quotes. Replaced the doublesh -c(escape applied twice) with a per-call bookkeeper script written to/tmp/yabby-bg/<id>.sh. Zero shell escaping; exit code captured viawait $C; $?. - Watchdog kill treated as failure in the notification branch. Clean SIGTERMs from FINAL_OUTPUT now route through the success branch.
- Startup sweep blindly orphaned still-alive bg rows.
server.jsnow checks each row's PID withkill -0before marking it orphaned. markOrphanedBgTasksDeadkilled allrunningrows on CLI close. Now PID-aware.
Full Changelog: v0.1.2...v0.1.3
Special thanks to @AyonPal for spotting the orphan-bookkeeping race and shipping #20 with tests.