openclaw/docs/gateway
Bill Chirico ca629296c6
feat(hooks): add agentId support to webhook mappings (#13672)
* feat(hooks): add agentId support to webhook mappings

Allow webhook mappings to route hook runs to a specific agent via
the new `agentId` field. This enables lightweight agents with minimal
bootstrap files to handle webhooks, reducing token cost per hook run.

The agentId is threaded through:
- HookMappingConfig (config type + zod schema)
- HookMappingResolved + HookAction (mapping types)
- normalizeHookMapping + buildActionFromMapping (mapping logic)
- mergeAction (transform override support)
- HookAgentPayload + normalizeAgentPayload (direct /hooks/agent endpoint)
- dispatchAgentHook → CronJob.agentId (server dispatch)

The existing runCronIsolatedAgentTurn already supports agentId on
CronJob — this change simply wires it through from webhook mappings.

Usage in config:
  hooks.mappings[].agentId = "my-agent"

Usage via POST /hooks/agent:
  { "message": "...", "agentId": "my-agent" }

Includes tests for mapping passthrough and payload normalization.
Includes doc updates for webhook.md.

* fix(hooks): enforce webhook agent routing policy + docs/changelog updates (#13672) (thanks @BillChirico)

* fix(hooks): harden explicit agent allowlist semantics (#13672) (thanks @BillChirico)

---------

Co-authored-by: Pip <pip@openclaw.ai>
Co-authored-by: Gustavo Madeira Santana <gumadeiras@gmail.com>
2026-02-10 19:23:58 -05:00
..
security Replace text diagrams with mermaid (#7165) 2026-02-09 10:27:27 -05:00
authentication.md revert(docs): undo markdownlint autofix churn 2026-02-06 10:00:08 -05:00
background-process.md Docs: add nav titles across docs (#5689) 2026-01-31 15:04:03 -06:00
bonjour.md Docs: enable markdownlint autofixables except list numbering (#10476) 2026-02-06 10:08:59 -05:00
bridge-protocol.md Docs: add nav titles across docs (#5689) 2026-01-31 15:04:03 -06:00
cli-backends.md chore: apply local workspace updates (#9911) 2026-02-05 16:54:44 -05:00
configuration-examples.md fix: unify session maintenance and cron run pruning (#13083) 2026-02-09 20:42:35 -08:00
configuration.md feat(hooks): add agentId support to webhook mappings (#13672) 2026-02-10 19:23:58 -05:00
discovery.md Docs: add nav titles across docs (#5689) 2026-01-31 15:04:03 -06:00
doctor.md Docs: add nav titles across docs (#5689) 2026-01-31 15:04:03 -06:00
gateway-lock.md Docs: add nav titles across docs (#5689) 2026-01-31 15:04:03 -06:00
health.md Docs: add nav titles across docs (#5689) 2026-01-31 15:04:03 -06:00
heartbeat.md docs: canonicalize docs paths and align zh navigation (#11428) 2026-02-07 15:40:35 -05:00
index.md Docs: enable markdownlint autofixables except list numbering (#10476) 2026-02-06 10:08:59 -05:00
local-models.md Docs: enable markdownlint autofixables except list numbering (#10476) 2026-02-06 10:08:59 -05:00
logging.md Docs: add nav titles across docs (#5689) 2026-01-31 15:04:03 -06:00
multiple-gateways.md Docs: add nav titles across docs (#5689) 2026-01-31 15:04:03 -06:00
network-model.md Docs: landing page revamp (#8885) 2026-02-04 10:37:14 -05:00
openai-http-api.md Docs: add nav titles across docs (#5689) 2026-01-31 15:04:03 -06:00
openresponses-http-api.md Docs: add nav titles across docs (#5689) 2026-01-31 15:04:03 -06:00
pairing.md Docs: add nav titles across docs (#5689) 2026-01-31 15:04:03 -06:00
protocol.md Docs: add nav titles across docs (#5689) 2026-01-31 15:04:03 -06:00
remote-gateway-readme.md Replace text diagrams with mermaid (#7165) 2026-02-09 10:27:27 -05:00
remote.md docs: restructure Get Started tab and improve onboarding flow (#9950) 2026-02-05 17:45:01 -05:00
sandbox-vs-tool-policy-vs-elevated.md chore: Run `pnpm format:fix`. 2026-01-31 21:13:13 +09:00
sandboxing.md docs: canonicalize docs paths and align zh navigation (#11428) 2026-02-07 15:40:35 -05:00
tailscale.md Docs: enable markdownlint autofixables except list numbering (#10476) 2026-02-06 10:08:59 -05:00
tools-invoke-http-api.md Docs: add nav titles across docs (#5689) 2026-01-31 15:04:03 -06:00
troubleshooting.md docs: canonicalize docs paths and align zh navigation (#11428) 2026-02-07 15:40:35 -05:00