Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/hive-c0re/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
müde 79a46f359a agent_web_port: collision-aware sticky allocation
operator hit 'coder' and 'test' colliding on the same hashed port —
fnv-1a mod 900 has ~0.1% collision probability per pair and clearly
that's not enough. agent_web_port goes stateful:

- per-agent port persisted to /var/lib/hyperhive/agents/<name>/port
- on first call, look up the file; if absent, hash, then probe
  forward through the allocated range skipping any port other
  agents already claim, then write the chosen value back
- subsequent calls return the persisted port (sticky)

other agents' ports come from their port file if present, else the
fallback is the hashed value — that handles existing deployments
without forcing a rebuild-all just to migrate. rebuilding the
colliding agent re-runs agent_web_port, sees its peer's implicit
hash port as taken, picks the next free slot, persists.

range exhaustion (very unlikely — 900 slots) logs a warning and
returns the hash; the bind-with-retry on the harness will surface
the failure honestly rather than silently looping.
2026-05-15 20:41:18 +02:00
..
actions.rs dashboard: spinners on in-flight lifecycle actions + cleaner row layout 2026-05-15 19:49:43 +02:00
agent_server.rs agent page: inbox view of last 30 messages addressed to this agent 2026-05-15 20:32:19 +02:00
approvals.rs phase 8 step 2: approval-gated spawn + dashboard spinner 2026-05-15 12:53:13 +02:00
auto_update.rs per-agent /state dir for durable notes; manager sees them via /agents 2026-05-15 18:00:08 +02:00
broker.rs agent page: inbox view of last 30 messages addressed to this agent 2026-05-15 20:32:19 +02:00
client.rs hive-c0re: admin socket server + client (stub dispatch) 2026-05-14 20:49:11 +02:00
coordinator.rs agents get a kickoff inbox message on start/restart/rebuild 2026-05-15 20:19:36 +02:00
dashboard.rs web ui: retry binding on AddrInUse during restart races 2026-05-15 20:33:51 +02:00
events_vacuum.rs events.sqlite vacuum moves host-side 2026-05-15 20:10:34 +02:00
lifecycle.rs agent_web_port: collision-aware sticky allocation 2026-05-15 20:41:18 +02:00
main.rs dashboard: lifecycle_action helper collapses start/stop/restart/rebuild 2026-05-15 20:12:03 +02:00
manager_server.rs ask_operator: ttl_seconds auto-cancel + remaining-time chip 2026-05-15 20:38:02 +02:00
operator_questions.rs ask_operator: ttl_seconds auto-cancel + remaining-time chip 2026-05-15 20:38:02 +02:00
server.rs destroy --purge: also wipe agent state dirs 2026-05-15 19:29:14 +02:00