Skip to content

feat: callback metadata, lifecycle webhooks, spawn ENOENT retry#123

Merged
c-h- merged 1 commit intomainfrom
charlie/boomerang
Mar 8, 2026
Merged

feat: callback metadata, lifecycle webhooks, spawn ENOENT retry#123
c-h- merged 1 commit intomainfrom
charlie/boomerang

Conversation

@c-h-
Copy link
Copy Markdown
Collaborator

@c-h- c-h- commented Mar 8, 2026

Summary

Implements the core agentctl side of the coding-agent completion boomerang pattern — enabling completion events to route back to the originating OpenClaw session.

Changes

#104 — Callback session metadata

  • --callback-session <key> and --callback-agent <id> CLI flags on agentctl launch
  • Stored in session.meta as openclaw_callback_session_key / openclaw_callback_agent_id
  • Propagated through daemon launch, multi-adapter orchestration
  • Surfaced in list --json, status --json output

#108 — Native lifecycle webhook emission

  • Daemon emits start/stop webhooks on session state transitions
  • Reads webhook_url + webhook_secret from ~/.agentctl/config.json or env vars
  • Payload: {hook_type, session_id, cwd, adapter, duration_seconds, exit_status, summary, meta, timestamp}
  • HMAC-SHA256 signature, fire-and-forget, works for ALL harnesses

#120 — Spawn ENOENT retry

  • New spawnWithRetry() utility used by all adapter launch methods
  • On ENOENT: waits 500ms, clears binary cache, re-resolves path, retries once

Tests

  • 488 tests passing (30 test files)
  • New: webhook.test.ts (10 tests), spawn-with-retry.test.ts (3 tests)

Fixes #104, Fixes #108, Fixes #120

- #104: Add --callback-session and --callback-agent CLI flags to launch.
  Stored in session.meta as openclaw_callback_session_key / openclaw_callback_agent_id.
  Propagated through daemon launch, multi-adapter orchestration, and surfaced in
  list/status --json output.

- #108: Native lifecycle webhook emission from daemon. Reads webhook_url and
  webhook_secret from config (~/.agentctl/config.json) or env vars
  (AGENTCTL_WEBHOOK_URL, AGENTCTL_WEBHOOK_SECRET). On running→stopped transitions
  POSTs {hook_type, session_id, cwd, adapter, duration_seconds, exit_status,
  summary, meta, timestamp} with HMAC-SHA256 signature. Fire-and-forget across
  all detection paths (session.stop, reconcile, PID liveness cleanup).

- #120: Spawn ENOENT retry. All adapter launch() methods now use spawnWithRetry()
  which on ENOENT waits 500ms, calls clearBinaryCache(), re-resolves the binary
  path, and retries once.

Fixes #104, Fixes #108, Fixes #120

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@c-h- c-h- merged commit 1ce7843 into main Mar 8, 2026
1 check passed
c-h- pushed a commit that referenced this pull request Mar 10, 2026
Features:
- Phase 1 ACP adoption — Codex adapter via ACP transport (#127)
- Callback metadata + lifecycle webhooks (#123)
- ADR-001: adopt ACP as primary agent interface (#126)
- Stateless daemon core (#117)

Fixes:
- Eliminate pending- session IDs — resolve real ID at launch (#131)
- Webhook numeric exit_status + compatible HMAC headers (#128)
- Daemon env derivation at spawn time (#119)
- Binary resolve util update (#121)

Docs:
- Full documentation audit and alignment (#132)
c-h- added a commit that referenced this pull request Mar 10, 2026
Features:
- Phase 1 ACP adoption — Codex adapter via ACP transport (#127)
- Callback metadata + lifecycle webhooks (#123)
- ADR-001: adopt ACP as primary agent interface (#126)
- Stateless daemon core (#117)

Fixes:
- Eliminate pending- session IDs — resolve real ID at launch (#131)
- Webhook numeric exit_status + compatible HMAC headers (#128)
- Daemon env derivation at spawn time (#119)
- Binary resolve util update (#121)

Docs:
- Full documentation audit and alignment (#132)

Co-authored-by: Doink (OpenClaw) <charlie+doink@kindo.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant