Add webhook event push (session.completed / session.failed) #19
Loading…
Reference in a new issue
No description provided.
Delete branch "oss-oo/webhook-push"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
The observatory gains true push instead of poll: whenever a session that was observed running lands on a terminal
completed/failedstatus infetch_sessions(), every registered webhook subscribed to that event receives an HTTP POST — the first step towards a real event bus.API
POST /api/webhooks/register— body{"url": "http://…", "events": ["session.completed", "session.failed"]}(events optional = all); validates absolutehttp(s)URL and known event names (400 otherwise), returns 201 with the stored record incl. itswh-…idGET /api/webhooks— list registered webhooksDELETE /api/webhooks/<id>— remove one (404 when unknown)Event payload
Behavior
~/.config/zcode-dispatch/webhooks.json(override:ZDO_WEBHOOKS_FILE)do_POSTregister handling extracted into_register_webhook()to stay within pylint's branch budgetVerification
4ce20838…): all validators green — note this required fixing pre-existing findings in.github/generate-icon.py(added in #18 whose checks never ran; the regeneratedicon.pngis byte-identical). The repo's.python-pylint/.python-rufffiles are dead config for this image version (it expects.python-lint/.ruff.toml) — left untouched hereCloses the Pinky task: push statt Poll.