feat(services): add service_aibroker.nu #91

Merged
mahmoud merged 1 commit from development_service_aibroker into development 2026-04-19 21:34:08 +00:00
Owner

Adds tools/modules/services/service_aibroker.nu for the hero_aibroker service (server + UI).

Three deviations from the service_db baseline:

  • New svx_seed_models_config preflight copies the repo's modelsconfig.yml into ~/hero/var/hero_aibroker/ on first start (preserves operator edits unless --reset).
  • New svx_check_api_keys preflight warns non-fatally when OPENROUTER_API_KEY / GROQ_API_KEY are unset in the invoking env.
  • Server env computed at action-build time (books pattern): MODELS_CONFIG_PATH, OPENROUTER_API_KEYS, GROQ_API_KEY.

Server binds two UDS (rpc.sock + rest.sock) in one process; kill_other lists both. UI binds ui.sock and proxies REST.

Smoke-tested end to end on Hetzner — full summary on the sub-issue. Warning path validated (service still reaches running + all health checks pass with no LLM keys in env); operator edits to modelsconfig.yml preserved across restart without --reset.

Closes #90
Refs #75

Adds `tools/modules/services/service_aibroker.nu` for the `hero_aibroker` service (server + UI). Three deviations from the `service_db` baseline: - New `svx_seed_models_config` preflight copies the repo's `modelsconfig.yml` into `~/hero/var/hero_aibroker/` on first start (preserves operator edits unless `--reset`). - New `svx_check_api_keys` preflight warns non-fatally when `OPENROUTER_API_KEY` / `GROQ_API_KEY` are unset in the invoking env. - Server env computed at action-build time (books pattern): `MODELS_CONFIG_PATH`, `OPENROUTER_API_KEYS`, `GROQ_API_KEY`. Server binds two UDS (`rpc.sock` + `rest.sock`) in one process; `kill_other` lists both. UI binds `ui.sock` and proxies REST. Smoke-tested end to end on Hetzner — full summary on the sub-issue. Warning path validated (service still reaches `running` + all health checks pass with no LLM keys in env); operator edits to `modelsconfig.yml` preserved across restart without `--reset`. Closes #90 Refs #75
Adds tools/modules/services/service_aibroker.nu managing the
hero_aibroker service lifecycle through hero_proc. Two registered
actions (hero_aibroker_server, hero_aibroker_ui) plus the hero_aibroker
CLI and hero_broker_server peer workspace binary shipped alongside.

Three deviations from the service_db template:
- New svx_seed_models_config preflight copies the repo's default
  modelsconfig.yml into ~/hero/var/hero_aibroker/ on first start;
  preserves operator edits unless --reset is passed.
- New svx_check_api_keys preflight warns (non-fatally) when
  OPENROUTER_API_KEY or GROQ_API_KEY is unset in the invoking env.
- Server env is computed at action-build time (books pattern):
  MODELS_CONFIG_PATH derived from svc_home, API keys captured from
  the invoking env.

Server binds two UDS (rpc.sock + rest.sock) in one process;
kill_other lists both so hero_proc reclaims them on restart. UI
binds ui.sock and proxies REST to rest.sock.

Smoke-tested end to end on Hetzner with --root: 4-binary install,
modelsconfig.yml seeded, missing-key warning fires when env is
unset, service starts and passes health checks, all three socket
probes green (OpenRPC 33 methods, REST /health 200, UI HTML 83KB),
--reset reclaims all three sockets across restart, operator edits
to modelsconfig.yml preserved on restart-without-reset, clean stop.

Refs: #75
Closes: #90
mahmoud merged commit 6ca61a0b90 into development 2026-04-19 21:34:08 +00:00
mahmoud deleted branch development_service_aibroker 2026-04-19 21:34:13 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_skills!91
No description provided.