Integrate hero_agent (Rust shrimp replacement) into Hero OS #72

Closed
opened 2026-03-20 23:20:03 +00:00 by mik-tf · 1 comment
Owner

Context

hero_agent (https://github.com/mik-tf/hero_agent) is a Rust-native AI agent that replaces hero_shrimp (Bun/TypeScript). It has ~12K lines of Rust across 3 crates with agent loop, LLM client, MCP tools, memory, triage, SSE streaming, and skill system.

Currently it uses raw Unix socket binding (zinit-style). It needs to be integrated into the Hero OS service ecosystem.

What needs to happen

1. Move to hero_proc lifecycle

  • Add hero_proc_sdk dependency
  • Add --start / --stop CLI flags for managed lifecycle
  • Register Service + Action with hero_proc on --start
  • Add health check registration (OpenRPC socket check)
  • Add ProcLogger for dual-logging (tracing + hero_proc logs tab)

2. Add admin UI (hero_agent_ui)

  • Create hero_agent_ui crate following hero_ui_dashboard pattern
  • Askama templates + embedded Bootstrap (no CDN)
  • Standard navbar with connection-status.js status dot
  • Tabs: Conversations, Skills, Config, Logs, API Docs
  • Sidebar with stats (active conversations, loaded skills, memory count)
  • /rpc proxy to hero_agent_server

3. Service configuration

  • Create hero_services/services/hero_agent.toml
  • Add to hero_services/profiles/user.toml
  • Add to build script (docker/build-local.sh)
  • Add to cargo-local-patches.toml if needed

4. Hero OS integration

  • Add island metadata to hero_os_app/src/registry.rs (Intelligence tab)
  • Add ExternalServiceIframe entry in island_content.rs
  • Replace shrimp references with hero_agent

5. Smoke tests

  • Health endpoint test
  • RPC connectivity test
  • Connection status indicator test
  • SSE streaming test

Why

  • Eliminates Bun dependency (only Rust + cargo build)
  • Same build/deploy model as every other Hero service
  • Native OSIS SDK integration (no RPC bridge)
  • Auto-gets: health, discovery, inspector dashboard, MCP gateway
  • Smaller binary (~20MB vs 122MB)

Notes

  • hero_shrimp should continue to work until hero_agent is fully validated
  • Frontend (AI island) requires zero changes — same SSE protocol
  • The repo is at https://github.com/mik-tf/hero_agent — needs to be moved to forge.ourworld.tf

Signed-off-by: mik-tf

## Context `hero_agent` (https://github.com/mik-tf/hero_agent) is a Rust-native AI agent that replaces `hero_shrimp` (Bun/TypeScript). It has ~12K lines of Rust across 3 crates with agent loop, LLM client, MCP tools, memory, triage, SSE streaming, and skill system. Currently it uses raw Unix socket binding (zinit-style). It needs to be integrated into the Hero OS service ecosystem. ## What needs to happen ### 1. Move to hero_proc lifecycle - Add `hero_proc_sdk` dependency - Add `--start` / `--stop` CLI flags for managed lifecycle - Register Service + Action with hero_proc on `--start` - Add health check registration (OpenRPC socket check) - Add ProcLogger for dual-logging (tracing + hero_proc logs tab) ### 2. Add admin UI (hero_agent_ui) - Create `hero_agent_ui` crate following hero_ui_dashboard pattern - Askama templates + embedded Bootstrap (no CDN) - Standard navbar with connection-status.js status dot - Tabs: Conversations, Skills, Config, Logs, API Docs - Sidebar with stats (active conversations, loaded skills, memory count) - `/rpc` proxy to hero_agent_server ### 3. Service configuration - Create `hero_services/services/hero_agent.toml` - Add to `hero_services/profiles/user.toml` - Add to build script (`docker/build-local.sh`) - Add to `cargo-local-patches.toml` if needed ### 4. Hero OS integration - Add island metadata to `hero_os_app/src/registry.rs` (Intelligence tab) - Add `ExternalServiceIframe` entry in `island_content.rs` - Replace shrimp references with hero_agent ### 5. Smoke tests - Health endpoint test - RPC connectivity test - Connection status indicator test - SSE streaming test ## Why - Eliminates Bun dependency (only Rust + cargo build) - Same build/deploy model as every other Hero service - Native OSIS SDK integration (no RPC bridge) - Auto-gets: health, discovery, inspector dashboard, MCP gateway - Smaller binary (~20MB vs 122MB) ## Notes - hero_shrimp should continue to work until hero_agent is fully validated - Frontend (AI island) requires zero changes — same SSE protocol - The repo is at https://github.com/mik-tf/hero_agent — needs to be moved to forge.ourworld.tf Signed-off-by: mik-tf
Author
Owner

Implemented and deployed to herodev

hero_agent fully replaces hero_shrimp in the Hero OS stack.

Changes across 7 repos

hero_agent (3 commits)

  • Default socket: hero_agent.sock, data dir: ~/hero/var/agent/
  • Added /api/voice/chat endpoint (STT → Agent → TTS via hero_aibroker)
  • Added clickable connection status popover to admin dashboard
  • Removed redundant SSE dot

hero_services

  • New hero_agent.toml service config (replaces hero_shrimp.toml)
  • Build: replaced Bun/TypeScript shrimp build with Rust hero_agent build
  • Removed shrimp socat bridge from entrypoint.sh
  • Updated profiles, bootstrap, smoke tests
  • Removed bun dependency from preflight.sh
  • Model list: sonnet (default), haiku, gpt-4o-mini, llama

hero_archipelagos

  • AI island uses agent_url() instead of shrimp_url()
  • All ai_service.rs references updated
  • Embed island points to /hero_agent

hero_os

  • Dock shows "Agent" instead of "Shrimp"

What works

  • AI chat via Intelligence tab with SSE streaming
  • Agent Admin dashboard with connection status popover
  • 56 built-in tools, markdown skills, MCP integration
  • Voice chat endpoint ready at /api/voice/chat
  • Smoke tests: 54 passed, 3 failed (pre-existing Redis issue)

Eliminated

  • Bun/TypeScript dependency
  • Shrimp socat bridge (hero_agent binds Unix socket directly)
  • ~100MB binary size reduction

Live at https://herodev.gent04.grid.tf

Signed-off-by: mik-tf

## Implemented and deployed to herodev hero_agent fully replaces hero_shrimp in the Hero OS stack. ### Changes across 7 repos **hero_agent** (3 commits) - Default socket: `hero_agent.sock`, data dir: `~/hero/var/agent/` - Added `/api/voice/chat` endpoint (STT → Agent → TTS via hero_aibroker) - Added clickable connection status popover to admin dashboard - Removed redundant SSE dot **hero_services** - New `hero_agent.toml` service config (replaces hero_shrimp.toml) - Build: replaced Bun/TypeScript shrimp build with Rust hero_agent build - Removed shrimp socat bridge from entrypoint.sh - Updated profiles, bootstrap, smoke tests - Removed bun dependency from preflight.sh - Model list: sonnet (default), haiku, gpt-4o-mini, llama **hero_archipelagos** - AI island uses `agent_url()` instead of `shrimp_url()` - All ai_service.rs references updated - Embed island points to `/hero_agent` **hero_os** - Dock shows "Agent" instead of "Shrimp" ### What works - AI chat via Intelligence tab with SSE streaming - Agent Admin dashboard with connection status popover - 56 built-in tools, markdown skills, MCP integration - Voice chat endpoint ready at `/api/voice/chat` - Smoke tests: 54 passed, 3 failed (pre-existing Redis issue) ### Eliminated - Bun/TypeScript dependency - Shrimp socat bridge (hero_agent binds Unix socket directly) - ~100MB binary size reduction Live at https://herodev.gent04.grid.tf 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#72
No description provided.