[nu-demo] service_install_all ends with no running services — registers action defs but doesn't call service.set, so hero_proc service start returns 'service not found' #167

Closed
opened 2026-04-24 14:48:15 +00:00 by mik-tf · 1 comment
Owner

Symptom

After a successful service_install_all --update run (20/20 services "succeeded"), binaries are installed under ~/hero/bin/, action definitions are registered in hero_proc via action.set RPC, but no services exist in the hero_proc service table:

$ hero_proc service list
No services configured

$ hero_proc service start hero_router
Error: RPC error -32000: service 'hero_router' not found

Individual actions ARE there:

$ hero_proc action list
...
hero_agent_server              exec
hero_agent_ui                  exec
hero_router                    exec
hero_embedderd                 exec
hero_embedder_server           exec
...
(75 actions total after a full install_all + manual build of the commented-out services)

Root cause

hero_proc has a two-layer model:

  1. Actions (action.set) — individual process specs (env, script, health_check).
  2. Services (service.set) — groups of actions that get started/stopped together.

The nu-shell modules service_<name>.nu call proc action set to register action specs. They SHOULD also call proc service set with a ServiceConfig record {context_name: "core", service: {name, actions: [...], class, description}} to group those actions under a named service.

Looking at e.g. service_osis.nu:

proc action set (svx_server_action $root) --root=$root | ignore
proc action set (svx_ui_action $root) --root=$root | ignore
proc service set (svc_service_config $SVX_SERVICE_NAME $SVX_ACTIONS $SVX_DESCRIPTION) --root=$root | ignore

The svc_service_config call IS there in service_osis.nu. But on a fresh herodemo VM running packages.nu::service_install_all, the services table stays empty — meaning the service.set call is either silently failing, or the per-module install closure isn't reaching that line, or the install helpers on this branch skip it.

Needs source audit per-service module.

Demo workaround (applied on herodemo 2026-04-24)

Wrote /data/home/driver/herodemo_set_services.py that iterates all action prefixes (hero_agent → [hero_agent_server, hero_agent_ui], hero_embedder → [hero_embedderd, hero_embedder_server, hero_embedder_ui], etc.) and POSTs service.set RPC for each with the correct class (user for hero_agent/books/embedder, system for the rest).

Result: 24 services created, all start cleanly via hero_proc service start <name>.

Proposed fix

  1. Audit every service_<name>.nu module to ensure it calls proc service set with a proper ServiceConfig after proc action set.
  2. Add a CI smoke test that after service_install_all on a fresh VM, hero_proc service list returns ≥20 services, and hero_proc service start hero_router succeeds.
  3. Bundle the service.set step into lib.nu::svx_standard_install_flow so every service module gets it for free without per-module boilerplate.
  • home#134 — packages.nu has service_browser/office/books/matrixchat/voice commented out (companion gap — some services aren't even called, on top of services that ARE called but don't register)
  • home#135 — service_agent.nu missing entirely
  • home#160 — consolidated state
  • home#163make demo one-shot target (blocks on this)

Signed-off-by: mik-tf

## Symptom After a successful `service_install_all --update` run (20/20 services "succeeded"), binaries are installed under `~/hero/bin/`, action definitions are registered in hero_proc via `action.set` RPC, but **no services exist in the hero_proc service table**: ``` $ hero_proc service list No services configured $ hero_proc service start hero_router Error: RPC error -32000: service 'hero_router' not found ``` Individual actions ARE there: ``` $ hero_proc action list ... hero_agent_server exec hero_agent_ui exec hero_router exec hero_embedderd exec hero_embedder_server exec ... (75 actions total after a full install_all + manual build of the commented-out services) ``` ## Root cause hero_proc has a two-layer model: 1. **Actions** (`action.set`) — individual process specs (env, script, health_check). 2. **Services** (`service.set`) — groups of actions that get started/stopped together. The nu-shell modules `service_<name>.nu` call `proc action set` to register action specs. They SHOULD also call `proc service set` with a ServiceConfig record `{context_name: "core", service: {name, actions: [...], class, description}}` to group those actions under a named service. Looking at e.g. `service_osis.nu`: ```nu proc action set (svx_server_action $root) --root=$root | ignore proc action set (svx_ui_action $root) --root=$root | ignore proc service set (svc_service_config $SVX_SERVICE_NAME $SVX_ACTIONS $SVX_DESCRIPTION) --root=$root | ignore ``` The `svc_service_config` call IS there in `service_osis.nu`. But on a fresh herodemo VM running `packages.nu::service_install_all`, the services table stays empty — meaning the `service.set` call is either silently failing, or the per-module install closure isn't reaching that line, or the install helpers on this branch skip it. Needs source audit per-service module. ## Demo workaround (applied on herodemo 2026-04-24) Wrote `/data/home/driver/herodemo_set_services.py` that iterates all action prefixes (hero_agent → [hero_agent_server, hero_agent_ui], hero_embedder → [hero_embedderd, hero_embedder_server, hero_embedder_ui], etc.) and POSTs `service.set` RPC for each with the correct class (user for hero_agent/books/embedder, system for the rest). Result: 24 services created, all start cleanly via `hero_proc service start <name>`. ## Proposed fix 1. **Audit every `service_<name>.nu` module** to ensure it calls `proc service set` with a proper ServiceConfig after `proc action set`. 2. **Add a CI smoke test** that after `service_install_all` on a fresh VM, `hero_proc service list` returns ≥20 services, and `hero_proc service start hero_router` succeeds. 3. **Bundle the service.set step into `lib.nu::svx_standard_install_flow`** so every service module gets it for free without per-module boilerplate. ## Related - [home#134](https://forge.ourworld.tf/lhumina_code/home/issues/134) — packages.nu has service_browser/office/books/matrixchat/voice commented out (companion gap — some services aren't even called, on top of services that ARE called but don't register) - [home#135](https://forge.ourworld.tf/lhumina_code/home/issues/135) — service_agent.nu missing entirely - [home#160](https://forge.ourworld.tf/lhumina_code/home/issues/160) — consolidated state - [home#163](https://forge.ourworld.tf/lhumina_code/home/issues/163) — `make demo` one-shot target (blocks on this) Signed-off-by: mik-tf
Author
Owner

Resolved by lhumina_code/hero_skills@7c823d1 (PR lhumina_code/hero_skills#126).

Part of Phase 2 tracker #185.

Resolved by https://forge.ourworld.tf/lhumina_code/hero_skills/commit/7c823d1 (PR https://forge.ourworld.tf/lhumina_code/hero_skills/pulls/126). Part of Phase 2 tracker https://forge.ourworld.tf/lhumina_code/home/issues/185.
Sign in to join this conversation.
No labels
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/home#167
No description provided.