Skip to content

Ship local-channels with agent-box (webhooks into agent sessions) #101

Description

@defangdevs

Requested by Lio (2026-07-17): agent-box should ship local-channels so every box user can wire webhooks (GitHub etc.) into their agent sessions, the way this dev box does.

What exists today (on nixos.defang.ca, hand-rolled)

  • defangdevs/local-channels repo: the local-webhook MCP/channel plugin (plus the temporary gh-webhook alias) — receiver daemon verifies HMAC from any signing source via sources.json, exposes webhook_subscribe / webhook_unsubscribe / webhook_subscriptions topic routing, state in ~/.local/state/local-webhook/.
  • A Caddy vhost (gh-webhook.<domain>) reverse-proxying to the receiver on localhost.
  • Plugin installed from a local directory marketplace; the agent launches with --channels plugin:local-webhook@local-channels.

What shipping it in agent-box needs

  • Receiver as a per-user (or shared) systemd service, bound to localhost, plus a managed Caddy vhost — the box already has wildcard-style vhost plumbing per user.
  • Plugin install + --channels flag wired into the session launch. Note: a channel attaches only at claude startup, so the flag has to be part of the supervisor's launch command, and the plugin must be installed before first session start.
  • Webhook secret provisioning: per-source HMAC secrets in sources.json; the settings page could own this (it already manages env secrets).
  • Pin/fetch strategy: modules/agent-box.nix must stay single-file (issue 51 — deployments fetchurl it alone), so local-channels gets pinned and fetched like the module/agent pins, not referenced as a sibling path.

Constraints / open questions

  • MCP channels are a research-preview feature (claude >= 2.1.80). For Team/Enterprise orgs the channel plugin must be allowlisted via console Admin Settings -> Managed settings (allowedChannelPlugins); a local managed-settings.json does not work. That's a per-customer manual step we can only document.
  • Users on plans without channel support get the MCP tools but no in-session deliveries — decide whether to ship anyway (tools still useful?) or gate on agent version.
  • One receiver per box vs per user: single port, so probably one shared receiver with per-user routing, or per-user receivers on distinct localhost ports each with their own vhost.
  • gh-webhook alias should NOT ship — new boxes start clean on local-webhook.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions