fix(cli): forward PATH_ROOT and HERO_SOCKET_DIR to spawned daemons #20
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_mik"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
hero_assistance --startpreviously brought uphero_assistance_servercleanly but lefthero_assistance_uiandhero_assistance_adminstuck in retrying state, panicking on every spawn withPATH_ROOT is not set.Root cause:
hero_assistance_serverhappens to survive without PATH_ROOT because its startup path does not callherolib_core::base::prepare_sockets; the other two daemons do, andresolve_socket_dirfalls through topath_varwhich callspath_root().expect(...)whenHERO_SOCKET_DIRis unset in the child env. hero_proc inherits its own env when spawning children, so the operator's shell PATH_ROOT never reaches the daemon unless the service definition forwards it explicitly.This is the same
forward_env_if_setpattern already in place inhero_os,hero_indexer,hero_matrixchat,hero_wallet,hero_runner_rhai,hero_code_indexer, andhero_onboarding. hero_assistance just missed it.Changes
forward_env_if_sethelper (10 LOC, same shape as the canonical pattern across the workspace)FORWARDED_ENVconst =[PATH_ROOT, PATH_VAR, PATH_BUILD, PATH_CODE, HERO_SOCKET_DIR]build_service_definition, one per action spec, afterhealth_checksis setphase24c_build_service_definition_forwards_lesson19_env_to_all_actionsunit test pinning the contractVerification
Live:
hero_assistance --startbrings up all 3 daemons;curl --unix-socket app.sock /returns 200 with the customer SPA HTML,curl --unix-socket admin.sock /returns 200,curl --unix-socket rpc.sock /healthreturns 200./proc/<child>/environshowsPATH_ROOT=/home/pctwo/heropropagated to all 3 children.Workspace tests
cargo test --release --workspace --no-fail-fast= 254 pass / 1 fail / 14 ignored, byte-stable vs the priorf22d819baseline; the lone fail is the pre-existing host-env flakephase24b_ui_add_access_fails_when_hero_proc_unreachable.cargo fmt --checkclean.cargo clippy --release --workspace --all-targets -- -D warningsclean.Fixes #16