Ops-dashboard/ops-agent/src
Janpeter Visser 6581a9ef33 fix(agent): await child completion in /agent/v1/exec route
Fastify-handler returnde direct na het attachen van event handlers.
Fastify finaliseerde dan de reply waardoor `req.raw.on('close')` direct
firede en `child.kill()` aanriep voordat het kind iets kon produceren.
Symptoom: SSE bevatte alleen `event:exit code:null` zonder stdout/stderr,
audit-log toonde `exit_code:null duration_ms:0`, dashboard-modules
toonden "No containers running" / "No data" terwijl handmatige command
prima werkte.

Wrap de event-handlers in een Promise zodat de async route-handler wacht
op child close/error voordat ie returnt. Verplaats client-disconnect
detectie van `req.raw.on('close')` naar `reply.raw.on('close')` — die
fired bij echte connectie-sluiting, niet bij request body parse.

Bevestigd: `docker_ps` retourneert nu volledige container-lijst, dashboard
/docker pagina rendert alle 6 containers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 22:23:30 +02:00
..
lib feat(flows): add YAML flow format, flow-runner, and /agent/v1/flow endpoint 2026-05-13 19:22:34 +02:00
routes fix(agent): await child completion in /agent/v1/exec route 2026-05-13 22:23:30 +02:00
auth.ts feat(auth): shared-secret auth web-app → ops-agent 2026-05-13 17:22:37 +02:00
index.ts feat(flows): add YAML flow format, flow-runner, and /agent/v1/flow endpoint 2026-05-13 19:22:34 +02:00
whitelist.ts feat(ops-agent): extend whitelist with destructive commands + preconditions 2026-05-13 17:53:05 +02:00