[nu-demo] hero_aibroker --reset reseeds modelsconfig.yml and clobbers operator edits #138

Closed
opened 2026-04-23 23:16:32 +00:00 by mik-tf · 1 comment
Owner

Symptom

Operator edits to ~/hero/var/hero_aibroker/modelsconfig.yml (e.g. removing groq backends — see companion issue #137) are lost every time service_aibroker --reset runs. The repo-level copy is blindly copied back over.

Root cause

service_aibroker.nu::svx_seed_models_config copies modelsconfig.yml from the cloned repo into ~/hero/var/hero_aibroker/ unconditionally on every --reset. There is no first-run guard and no merge step.

Demo workaround (applied 2026-04-23)

Edited BOTH the repo copy (~/hero/code0/hero_aibroker/.../modelsconfig.yml) AND the var/ copy, so reseed is at least idempotent with our edits. Fragile — any git pull in the repo would re-introduce the groq backends.

Proper fix

Pick one (in order of preference):
(a) Only seed on first run — write a .seeded marker after the initial copy, skip future reseeds unless --force-reset is passed.
(b) Respect a KEEP_LOCAL_EDITS=1 env var that skips the copy-over.
(c) Merge repo-level defaults with operator overrides (e.g. keep operator's explicit backend disables while picking up new models added upstream).

Filed 2026-04-23 nu-shell demo bring-up. Signed-off-by: mik-tf

## Symptom Operator edits to `~/hero/var/hero_aibroker/modelsconfig.yml` (e.g. removing groq backends — see companion issue #137) are lost every time `service_aibroker --reset` runs. The repo-level copy is blindly copied back over. ## Root cause `service_aibroker.nu::svx_seed_models_config` copies `modelsconfig.yml` from the cloned repo into `~/hero/var/hero_aibroker/` unconditionally on every `--reset`. There is no first-run guard and no merge step. ## Demo workaround (applied 2026-04-23) Edited BOTH the repo copy (`~/hero/code0/hero_aibroker/.../modelsconfig.yml`) AND the var/ copy, so reseed is at least idempotent with our edits. Fragile — any `git pull` in the repo would re-introduce the groq backends. ## Proper fix Pick one (in order of preference): (a) Only seed on first run — write a `.seeded` marker after the initial copy, skip future reseeds unless `--force-reset` is passed. (b) Respect a `KEEP_LOCAL_EDITS=1` env var that skips the copy-over. (c) Merge repo-level defaults with operator overrides (e.g. keep operator's explicit backend disables while picking up new models added upstream). Filed 2026-04-23 nu-shell demo bring-up. Signed-off-by: mik-tf
Author
Owner

Fixed in hero_skills tools/modules/services/service_aibroker.nusvx_seed_models_config now treats existing modelsconfig.yml as authoritative and only re-seeds when --reset is explicitly passed.

Verification (service_aibroker.nu):

  • L36-38 (docstring): "Any existing operator edits are preserved without --reset."
  • L101 (function header): "If the destination already exists and $reset is false, leaves it alone (operator edits preserved)."
  • L119-120 (guard): if $dest_exists and (not $reset) { print " → modelsconfig.yml already present at ($dest) — leaving operator edits intact" } then early-returns.
  • L141: log message distinguishes seeded vs re-seeded for first-run vs --reset.

This matches option (a) from the issue body: "Only seed on first run". Operators who want to pick up upstream changes pass --reset explicitly.

Signed-off-by: mik-tf

Fixed in hero_skills `tools/modules/services/service_aibroker.nu` — `svx_seed_models_config` now treats existing `modelsconfig.yml` as authoritative and only re-seeds when `--reset` is explicitly passed. Verification (`service_aibroker.nu`): - L36-38 (docstring): _"Any existing operator edits are preserved without --reset."_ - L101 (function header): _"If the destination already exists and `$reset` is false, leaves it alone (operator edits preserved)."_ - L119-120 (guard): `if $dest_exists and (not $reset) { print " → modelsconfig.yml already present at ($dest) — leaving operator edits intact" }` then early-returns. - L141: log message distinguishes `seeded` vs `re-seeded` for first-run vs `--reset`. This matches option (a) from the issue body: _"Only seed on first run"_. Operators who want to pick up upstream changes pass `--reset` explicitly. Signed-off-by: mik-tf
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#138
No description provided.