Conversation
…thread-mode keying
Document the adapter's slash-command HTTP endpoint: token setup, config.yaml host/port, Mattermost-side registration with autocomplete, and the reserved- range SSRF pitfall that silently blocks callbacks to mesh-VPN hosts.
|
Thanks for the triage. I looked at all three — here's how they relate to this PR: #12593 (native slash commands) — independent convergence on the same design: register #26537 → superseded by #29373, so considering #29373 only: #29373 (interactive approval buttons) — complementary rather than overlapping: it explicitly scopes out slash-command registration, which is exactly what this PR provides. The one real shared surface is callback infrastructure: both PRs add an aiohttp listener to No behavioral conflict between this PR and #29373 — different endpoints, different features. |
Problem
Mattermost's client intercepts any message starting with
/and treats it as a Mattermost command — unregistered ones like/modelare rejected locally and never reach the gateway. The adapter (WebSocket/REST only) had no way to receive server-side slash callbacks, so Hermes commands only worked with a leading-space hack, with no autocomplete and no argument hints.What this adds
0.0.0.0:8645, config viamattermost.slash_command_host/portin config.yaml). Receives Mattermost's form-urlencoded callbacks, validates the verification token with a constant-time compare againstMATTERMOST_SLASH_TOKENS(401 fail-closed), and injects the command as a native COMMAND event — allowed-channel gating, admin/user split, and ephemeral 200-ack all preserved. Plugin-only; no core files touched.send_typingnow forwards the thread root asparent_id, so "hermes is typing" appears in the thread/Threads view, matching native client behavior (webapp gates onparent_id === rootId).Validation
401on invalid tokens, exec-to-reply verified through Mattermost's own command executor.