feat: generic webhook inbound platform adapter + miniverse integration#1124
feat: generic webhook inbound platform adapter + miniverse integration#1124
Conversation
41048a5 to
b8d715c
Compare
Points to the external hermes-miniverse repo (teknium1/hermes-miniverse) which provides the bridge, gateway hook, and skill for connecting Hermes agents to Miniverse pixel worlds. No code changes to hermes-agent — everything lives externally.
Adds a lightweight HTTP server adapter that accepts POST /message
requests and routes them through the gateway as conversations. Each
unique chat_id gets its own session — supports multiple concurrent
agents/conversations with no race conditions.
The response is returned synchronously in the HTTP response body
(connection held until agent finishes, up to 300s timeout).
Enable with: WEBHOOK_PORT=4568
API:
POST /message {chat_id, message, from?, user_id?}
GET /health
This is a generic adapter usable by any external system:
miniverse bridges, n8n/Zapier webhooks, CI/CD pipelines,
custom automations, other agent frameworks, etc.
Also adds docs/integrations/miniverse.md pointing to the
external hermes-miniverse bridge repo.
474ca0f to
a886fbf
Compare
Cherry-picked from PR #1124 with an important fix: the original future-based response capture resolved on the FIRST send() call (which was often a notification, not the agent response). Replaced with an accumulator pattern that waits for processing to complete and returns the LAST send() — the actual agent response. Changes: - gateway/platforms/webhook.py: new adapter with accumulator pattern - gateway/config.py: Platform.WEBHOOK enum + env var handling - gateway/run.py: factory registration + auth bypass - gateway/session.py: webhook chat_id session isolation (like WhatsApp) - docs/integrations/miniverse.md: integration guide
Miniverse Integration — Progress & TODOWhat WorksWebhook Adapter (
Bridge (
Miniverse Frontend (
Known Bugs / Issues
The Big Unsolved ProblemMulti-agent collaboration is shallow. When two agents receive the same prompt:
This needs deeper architecture work — probably an agent-to-agent protocol where one agent can:
How to Resume# 1. Start miniverse server
cd ~/miniverse-server/my-miniverse
node ../packages/server/dist/cli.js --no-browser --port 4321 &
# 2. Start vite frontend
npx vite --host 0.0.0.0 --port 5173 &
# 3. Add WEBHOOK_PORT to ~/.hermes/.env and restart gateway
echo "WEBHOOK_PORT=4568" >> ~/.hermes/.env
hermes gateway restart
# 4. Start bridges (both point to same webhook adapter)
cd ~/hermes-miniverse
source ~/.hermes/hermes-agent/.venv/bin/activate
python bridge.py --server http://localhost:4321 \
--agent hermes-1 --name "Hermes (Coder)" --color "#CD7F32" \
--port 4567 --hermes-webhook http://localhost:4568 &
python bridge.py --server http://localhost:4321 \
--agent hermes-2 --name "Hermes (Research)" --color "#4ecdc4" \
--port 4570 --hermes-webhook http://localhost:4568 &
# 5. Expose frontend
cloudflared tunnel --config /dev/null --url http://localhost:5173
# 6. Open the tunnel URL — agents appear in the pixel world with chat panelPort Map
Related Branches
|
|
Miniverse fork now available: The customized This is a fork of To use it: git clone https://github.com/teknium1/miniverse
cd miniverse
npm install
cd my-miniverse
npm install
npm run devThe bridge, hooks, and skill remain in teknium1/hermes-miniverse. |
|
Built the follow-up for the big unsolved problem as a stacked PR on top of the accumulator-fix branch: PR: #1450 What this adds:
This is aimed directly at the shallow-collaboration gap you called out:
A couple of operational issues also got tightened while testing this against Miniverse/webhook flows:
Verified locally with direct webhook calls against both configured rooms:
Still out of scope in
If this direction looks right, |
|
Closing during PR triage — not pursuing this approach. |
What
A generic webhook platform adapter for the gateway that accepts HTTP POST requests and routes them as conversations. Enables any external system to send messages to Hermes with proper session management.
Webhook adapter (in hermes-agent — 3 files changed)
Each
chat_idmaps to a separate gateway session — supports multiple concurrent agents. No race conditions, proper session persistence, full gateway features.Generalizable: works with miniverse, n8n, Zapier, CI/CD, custom automations, other agent frameworks.
External repo (teknium1/hermes-miniverse)
Bridge + hook + skill for connecting Hermes to Miniverse pixel worlds. Uses the webhook adapter for proper multi-agent support.
Changes in hermes-agent
gateway/platforms/webhook.pygateway/config.pyPlatform.WEBHOOKenum + env var handlinggateway/run.pydocs/integrations/miniverse.mdTests
661 gateway tests pass, no regressions.