Hero OS Enhancements #23
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Hero OS Enhancements
Context
Follow-up from #17 (Docker build pipeline). Tracks UI improvements, service integration, and deployment across Hero OS environments.
Active Deployments
:dev2:demo2:dev:demoWorkflow
development_{name}feature branches, squash merge todevelopmentbuild-local.sh→Dockerfile.pack→ push →make update ENV=<env>rust:1.93-bookwormSession 1 — Completed
Toolbar/Dock
Hero Indexer
/rpcproxy endpoint for JSON-RPChero_indexer.sock)Hero Embedder
Hero Books
Hero Biz
forge_url rename (fossil → foundry)
hero_foundry.sock,hero_forge.sock,hero_fossil.sockContext switcher
Deploy Pipeline
:dev2image rebuilt with 29 servicesSession 2 — Completed
AIBroker Integration (TOP PRIORITY — done)
binary_path, added.branch()builder)rpcCallbefore content block)development_kristof→developmentbuild-local.sh,build-services.sh,Dockerfile.pack:dev2built, tested, promoted to:demo2Commits:
development: Dockerfile.pack fix, build scripts, service TOML with 5-model seeddevelopment_timur: ZinitLifecycle API, BASE_PATH, script ordering, theme sync — PR #21 ready for devops reviewSession 3 — Completed
MCP Integration: Hero Shrimp + AIBroker — VERIFIED on herodev2
Architecture Decision
Chose Path B (broker-mediated) over Path A (direct spawn):
mcp_heroas stdio child processmcp_hero(stdio)mcp.jsonin Shrimp workspaceMCP_BROKER_ENDPOINTenv var in ShrimpWhy Path B:
mcp_hero'sgenerate_codetool calls the broker's own/v1/chat/completionsvia Unix socket for LLM access.hero_proxy.mcp.tsalready supports REST broker discovery viaMCP_BROKER_ENDPOINT.Production Flow
Changes Made
hero_aibroker (
development_timur):mcp_servers.json: Addedmcp_heroentry, fixedmcp-*→mcp_*binary names, setHERO_LLM_MODELtogpt-4o-minimcp_servers.example.json: Same model fixhero_services (
development):services/user/hero_aibroker.toml: Addedmcp_servers.jsonheredoc generation at startup, addedMCP_CONFIG_PATHenv varservices/user/hero_shrimp.toml: Addeddepends_on = ["hero_aibroker"],MCP_BROKER_ENDPOINT,AIBROKER_API_ENDPOINT,SHRIMP_WORKSPACE_DIR, model configservices/user/hero_shrimp.toml: ChangedSHRIMP_OPENROUTER_MODELSfrom OpenRouter-format names (google/gemini-3-flash-preview) to AIBroker model names (gpt-4o-mini,claude-sonnet,llama-70b) so all LLM traffic routes through AIBrokerdocker/build-local.sh: Addedmcp_herobinary to aibroker build step, skill file copy todist/var/hero_shrimp (
development_timur):examples/mcp.json.hero_example: Fixed LLM model togpt-4o-miniVerification Results on herodev2
Issues Found and Fixed
mcp_herodefaulted togoogle/gemini-2.0-flash-001which isn't in modelsconfig.yml → fixed togpt-4o-minimcp-ping) but binaries use underscores (mcp_ping) → fixedbuild-local.shdidn't includemcp_heroin the aibroker build step → fixedgoogle/gemini-3-flash-preview) which AIBroker didn't recognize, causing fallback directly to OpenRouter → fixed by using AIBroker model names (gpt-4o-mini,claude-sonnet,llama-70b), now all LLM traffic goes through AIBrokerSession 4 — Completed
Shrimp Chat UI + Model Selection + Agent Loop Integration
claude-sonnet,gpt-4o,claude-haiku,llama-70b)gpt-4o-mini,llama-8b), addedclaude-haikuPOST /api/chatacceptsmodel, passes through to agent loopTODO — Next Sessions
Session 5.1 — Completed
Books Navigation
prevPath/nextPathinbooks.getPageRPC responseotherPages)hero_booksdevelopment—feat(server): add page navigation to books.getPage RPC responseSession 5.2 — Completed
Embedder UI — Load Documents fix
corpus.load(returns immediately, no progress). Switched to synchronouscorpus.load_batchAPI with batched loop (250 docs/batch), real progress bar, and optimistic sidebar updates.start_idxto begin from current namespace doc count (avoids re-processing existing docs as no-ops).window.isLoadingCorpusguard to preventpollNamespaceStats()from overwriting optimistic UI updates with stale async data.hero_embedderdevelopment—fix(ui): use corpus.load_batch for real progress bar in Load Documents(52abf5c)hero_books server.health fix
collectionsCountnow returns real library count viadiscover_namespaces()instead of hardcoded0.embedderConnectednow tests actual embedder connectivity viaVectorStore::connect()instead of hardcodedfalse.hero_booksdevelopment—fix(server): report real collectionsCount and embedderConnected in server.health(887da1c)Service lifecycle fixes
hero_books_serverzinit config: addedservesubcommand (binary requires it, was exiting immediately → inactive).zinit stop/startdoes NOT reload TOML config changes — must usezinit reloadfirst.hero_servicesdevelopment—fix: add serve subcommand to hero_books_server exec(c9315c9)Watchdog (stopgap for #25)
entrypoint.sh: polls every 60s, restarts inactive non-oneshot services..health/.install/.testoneshots andhero_cloud.hero_servicesdevelopment—fix: add serve subcommand to hero_books_ui + service watchdog(06e2cff)Librarian UX — done ✅
initVoiceSearch()(was calling non-existenttoggleVoiceRecording())hero_books_uinow requiresservesubcommand (zinit config updated).hero_booksdevelopment—fix(ui): add search spinner, fix voice transcription auto-submitSession 6 — Island & Service UI Polish
Files island
Songs island
Contacts island
Business / Biz
Store island
Calendar island
Redis admin UI
Books
Session 7 — Code/Development & Foundry
Backlog
Owned by devops team (timur, thabeta, kristof) — see #18
SHRIMP_OPENROUTER_MODELSduplication, fetch models dynamically from AIBroker/v1/modelsat startup (see #18 thabeta feedback)Verify later
/api/transcribehandler if it recurs.Low priority / non-blocking
wasm-packinDockerfile.basefor standalone island buildsAfter #23 — Infrastructure
Cross-Repo Branch Status
developmentdevelopmentdevelopmentdevelopment_timurdevelopment(needs devops review)development_timurdevelopmentwithout devops review)Reference — Operational Context
This section provides the details needed to pick up work in a new session without rediscovering everything.
SSH Access (via Mycelium IPv6)
ssh -6 root@503:b4a2:f8d6:8660:ff0f:a5a3:4288:fd88ssh -6 root@519:bd05:a120:4128:ff0f:c6f8:677c:aa63Container names match environment:
herodev2,herodemo2. Access container shell withdocker exec -it herodev2 bash.Relevant Claude Code Skills
Check these skills for patterns and conventions when working on specific areas:
hero_servicehero_ui_dashboardhero_ui_openrpc_proxy/rpcproxy pattern for admin UIshero_rpc_server_lifecycleOServer::run_cli(), zinit integration, socket conventionsenv_secretstfgrid_deployhero_socketsweb_embedhero_ecosystemzinit_cmdhero_branchingBuild Pipeline
Two deployment workflows: clean image build for shipping, hotfix deploy for rapid dev iteration.
Clean image build (from
hero_services/directory):Promote dev2 → demo2 (after validating on herodev2):
The
TAGvariable defaults todev2. Override withmake pack TAG=custom.Hotfix deploy (patch a single binary without full image rebuild):
Full ops documentation:
hero_services/docs/ops/deployment.mdKey Technical Patterns
BASE_PATH for iframe routing:
BASE_PATHenv var (e.g.,/hero_aibroker_ui)[env]section, read inmain.rs, injected into Tera templatesfetch(BASE_PATH + '/rpc', ...){{ base_path | safe }}in templates (the| safeprevents HTML escaping of/)Template paths (CARGO_MANIFEST_DIR):
CARGO_MANIFEST_DIRbaked into the binary/src/lhumina_code/<repo>//src/lhumina_code/<repo>/crates/<crate>/templates/Dockerfile.packmust COPY templates to this exact pathTheme sync (Hero OS ↔ service iframes):
hero:thememessage listener JSvar(--bs-body-bg),var(--bs-body-color),var(--bs-tertiary-bg),var(--bs-border-color)) — NOT hardcoded colorsbg-dark text-whiteclasses on form controls — Bootstrap handles this viadata-bs-themedata-bs-themeon<html>when Hero OS sends a theme messageEnv var resolution in service TOMLs:
__HERO_BIN__,__HERO_VAR__patterns are resolved by hero_services_server${VAR_NAME}patterns (e.g.,${OPENROUTER_API_KEY}) reference container environment variablesapp.env→docker run -e→ container env → zinit service envupdate.shscript regenerates the container run script with API keys fromapp.envService TOML Structure
Service configs live in
hero_services/services/user/. Each TOML has:[service]— name, description[build]— git URL, branch, install method[server]— exec command (can be heredoc for seed data),kill_others[ui]— exec command,kill_others[env]— env vars (__VAR__for paths,${VAR}for secrets)[profile]— actions listExample with seed heredoc (hero_aibroker): the server exec uses
sh -c 'mkdir -p ... && cat > config.yml << EOF ... EOF\nexec binary serve'to create config on first start.API Key Management
Keys are stored in
deploy/single-vm/envs/<env>/app.envand passed into the container viadocker run -e. Current keys:OPENROUTER_API_KEY— OpenRouter (GPT-4o, GPT-4o Mini, Claude Sonnet)GROQ_API_KEY— Groq (Llama 70B, Llama 8B)FORGEJO_TOKEN— Forge registry login + git cloneTo update a key: edit
app.env, thenmake update ENV=<env>to regenerate the container run script.Hero OS UI polish: toolbar fixes, Books/Biz integration, seed data, icon renderingto Hero OS UI polish: service dashboards, iframe integration, seed data, icon renderingHero OS UI polish: service dashboards, iframe integration, seed data, icon renderingto Hero OS Enhancementsmik-tf referenced this issue2026-03-12 21:42:51 +00:00