Files
loki/scripts
g-butandClaude Opus 4.7 a003696e7c fix(orchestration): close outcome-tracking loop in cloud mode
Verifying the sleep-mode loop surfaced this gap: cloud-mode dispatches go
through pending_commands and never created an orchestration_runs row, so
agent-hook-bridge.sh:finish_orchestration_run silently no-opped on Vercel
(no /tmp/cockpit-run-<tab> sentinel was ever written).

- InjectPayload gains an optional runId so the run id can be threaded from
  server-side dispatch to the local daemon over the pending-commands queue.
- /api/orchestration/run cloud-mode block now creates a tracked run row
  before enqueueing (mirroring the local-mode path), excluding lifecycle
  intents. runId is returned to the caller so the client can correlate.
- cockpit-daemon.sh:inject case reads payload.runId and writes the
  /tmp/cockpit-run-<tab> sentinel before execute_inject, so the existing
  stop hook closes the loop unchanged.

With this, the next live agent run dispatched from cockpitapp.vercel.app
will produce its first end-to-end outcome row.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 20:52:06 +02:00
..