14 Commits
Author SHA1 Message Date
hermes-agent c345dab9c1 Merge pull request 'adapter: support OpenAI streaming (SSE) in /v1/chat/completions' (#1) from feat/adapter-streaming into main 2026-09-12 12:51:34 +02:00
hermes-agent 2d46eda619 adapter: support OpenAI streaming (SSE) in /v1/chat/completions
OpenCode's @ai-sdk/openai-compatible sends stream:true and would render an
empty response because the adapter always returned a single non-streaming
chat.completion JSON body. Now when stream:true, emit OpenAI-compatible SSE
chat.completion.chunk events (role, content, [DONE]) so streaming clients
render text. Non-streaming path unchanged.

Adds a local EchoServer test that exercises the streaming route end-to-end.
2026-09-12 10:50:47 +00:00
hermes-agent beb9b1b3ef Add temporary chat-request logging (diagnose SwiftChat error) 2026-09-11 18:44:45 +00:00
hermes-agent cb512a7f17 admin: serve the page without requiring the Bearer header
A browser opening /admin can't send an Authorization header, so the
admin page was unreachable (401 blank). Serve the HTML form openly — it
exposes no data — and let the in-page ADMIN_API_KEY field drive the
auth'd /admin/agents CRUD calls.
2026-09-11 15:36:15 +00:00
hermes-agent e4fdeb6b79 nixos-module: set RELEASE_COOKIE so the release starts
The Elixir release's start script reads releases/COOKIE which isn't baked
in, so the service crashed on boot (cat: releases/COOKIE: No such file).
Set RELEASE_COOKIE in the systemd Environment to fix startup.
2026-09-10 14:35:28 +00:00
hermes-agent 6b22171018 flake: fill mixFodDeps hash 2026-09-10 07:21:42 +00:00
hermes-agent f0112289e6 flake: add mixFodDeps (fetchMixDeps) for Hex deps 2026-09-10 07:17:56 +00:00
hermes-agent 72e18a0a0c Remove AGENTS env seeding; agents managed only via admin API
The store now starts empty and agents are added/removed exclusively through
the web admin page / admin API, persisted to AGENTS_FILE. No AGENTS env var
needed in the sops secret.
2026-09-10 07:06:26 +00:00
hermes-agent e2be3f652e Add web admin page to manage agents
GET /admin serves a self-contained HTML page (ADMIN_API_KEY protected)
that lists agents and lets you add/update/remove them via the admin API —
no redeploy needed to add an agent.
2026-09-10 06:59:08 +00:00
hermes-agent 490bd32322 Add admin API to manage agents at runtime
- AgentRegistry is now file-backed (AGENTS_FILE, default
  /var/lib/n8n-openai/agents.json): agents persist across restarts and
  can be added/removed without a redeploy.
- New admin endpoints (separate ADMIN_API_KEY):
    GET    /admin/agents
    POST   /admin/agents   {model, webhook}
    DELETE /admin/agents/:model
- AGENTS env only seeds the store on first boot; the file is authoritative.
- NixOS module sets AGENTS_FILE under the writable StateDirectory.
2026-09-10 06:46:05 +00:00
hermes-agent 1bfcba133a Add NixOS module for the adapter service
Export nixosModules.default so the service (systemd unit, service user,
sops secret) is defined in the flake, not re-declared in each host config.
Consume with imports = [ inputs.n8n-openai-adapter.nixosModules.default ]
+ services.n8n-openai-adapter = { enable = true; domain = ...; port = ...; }.
2026-09-10 06:36:44 +00:00
hermes-agent c3d024c16c Apply mix format 2026-09-09 21:46:16 +00:00
hermes-agent 1530a761d5 Add flake.lock pinning nixpkgs 2026-09-09 21:44:55 +00:00
hermes-agent 5197b6ece6 OpenAI-compatible adapter for n8n chat agents (Elixir)
Exposes self-hosted n8n chat agents behind /v1/chat/completions and
/v1/models. Model -> n8n webhook routing via a GenServer registry, so
multiple agents map to multiple models. Plug + Bandit, req for the
n8n webhook call, Bearer auth (ADAPTER_API_KEY). Ships a flake.nix
(beamPackages.mixRelease) so it can be consumed as a NixOS flake input.
2026-09-09 21:43:21 +00:00