Files
hermes-relay/hermes_relay_bootstrap.pth
Bailey DixonandClaude Opus 4.6 b6db95caf9 feat(plugin): runtime API bootstrap + capability auto-detect + canonical uninstaller
Adds hermes_relay_bootstrap/ — a Python package shipped via .pth in the
hermes-agent venv site-packages — that monkey-patches aiohttp.web.Application
at interpreter startup. When the gateway builds its app, the bootstrap
intercepts app["api_server_adapter"] = self and injects 14 management
handlers onto the same router: /api/sessions/* CRUD, /api/memory,
/api/skills, /api/config, /api/available-models. Feature-detects on route
path and no-ops cleanly when these routes are already present, so it's
safe to ship across all hermes-agent versions.

Chat streaming continues to use standard upstream /v1/runs (which already
emits structured tool events). The Android client gains a new
ServerCapabilities probe + streamingEndpoint = "auto" default that picks
the best chat path automatically based on what each server actually
exposes (Auto/Sessions/Runs).

Also adds canonical uninstall.sh — reverses every install.sh step in the
opposite order, idempotent, never touches state shared with other Hermes
tools (.env, sessions DB, hermes-agent venv core). Flags: --dry-run,
--keep-clone, --remove-secret. install.sh header + success summary +
README + user-docs/guide/getting-started.md + user-docs/reference/api.md
all updated to mention the uninstall path.

Verified end-to-end on the server: bootstrap loads via .pth, intercepts
aiohttp.web import, injects 11 unique paths onto a vanilla aiohttp app,
GET /api/sessions returns real production data via SessionDB, OPTIONS
probes return the expected 405/404 codes for capability detection, and
feature detection no-ops cleanly when routes already exist.

See docs/decisions.md ADR 16 for full rationale and DEVLOG.md
2026-04-12 entries for the work breakdown.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 17:42:58 -04:00

2 lines
30 B
Plaintext

import hermes_relay_bootstrap