hyperhive/hive-ag3nt/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
iris a725d34b19 harness: emit needs_login_idle on every wait_for_login entry (closes #563)
mara on #563: 'we fixed the agent to not start turns in that
state (it fell back to online before), but this does not show on
dashboard properly'.

Root cause: the per-agent harness flips LoginState::NeedsLogin in
memory on three entry paths (cold-boot without a session, 401
mid-turn, /api/logout) and parks in wait_for_login. But
wait_for_login itself never called bus.emit_status('needs_login_idle')
at entry — only the /api/logout handler does that today. So:

- Cold boot: agent has no session, harness shows 'needs login'
  on its own web UI (via LoginState mutex), but the dashboard's
  needs_login field stays false because the
  {state_dir}/hyperhive-needs-login sentinel was never written.
- 401 mid-turn: same — the 'after a turn failed' path in
  hive-ag3nt.rs / hive-m1nd.rs flips LoginState directly without
  emitting status, then calls wait_for_login, which now waits
  silently with no sentinel write.

Fix: hoist the emit_status('needs_login_idle') call into
wait_for_login itself. All three entry paths get the sentinel
write for free; the /api/logout handler's explicit call (web_ui.rs
line 966) becomes redundant but idempotent — no behaviour change
there. The 'online' clear at session refresh stays exactly where
it was at the loop's exit.

Both hive-ag3nt and hive-m1nd binaries share wait_for_login, so the
manager harness benefits without a separate change.
2026-05-29 19:28:42 +02:00
..
bin harness: unify agent + manager prompts into single template (closes #519) 2026-05-28 00:33:43 +02:00
client.rs docs: add missing #[must_use], # Errors, # Panics across public api 2026-05-22 19:41:27 +02:00
events.rs clippy: fix lints that crane's cargoClippy properly enforces (#538) 2026-05-29 01:45:48 +02:00
forge_notify.rs clippy: fix lints that crane's cargoClippy properly enforces (#538) 2026-05-29 01:45:48 +02:00
identity.rs identity: serialise env-mutating tests on a module mutex (damocles #595 nit) 2026-05-29 19:13:01 +02:00
lib.rs hive-ag3nt: identity module with hive-qualified label (#589 phase A, first PR) 2026-05-29 19:09:44 +02:00
login.rs refactor: per-agent state paths (/agents/{label}/state), centralize in paths.rs 2026-05-16 15:18:32 +02:00
login_session.rs docs: add missing #[must_use], # Errors, # Panics across public api 2026-05-22 19:41:27 +02:00
mcp.rs clippy: fix lints that crane's cargoClippy properly enforces (#538) 2026-05-29 01:45:48 +02:00
paths.rs fix: manager uses /agents/hm1nd/state, not /state, for HYPERHIVE_STATE_DIR 2026-05-20 13:35:12 +02:00
plugins.rs add optional in_reply_to field on send for conversation threading 2026-05-20 13:35:27 +02:00
prompt.rs hive-ag3nt: identity module with hive-qualified label (#589 phase A, first PR) 2026-05-29 19:09:44 +02:00
serve_common.rs harness: flip into needs_login on 401 mid-turn (closes #419) 2026-05-25 21:50:21 +02:00
stats.rs docs: add missing #[must_use], # Errors, # Panics across public api 2026-05-22 19:41:27 +02:00
turn.rs harness: emit needs_login_idle on every wait_for_login entry (closes #563) 2026-05-29 19:28:42 +02:00
turn_stats.rs docs: add missing #[must_use], # Errors, # Panics across public api 2026-05-22 19:41:27 +02:00
web_ui.rs hive-ag3nt: identity module with hive-qualified label (#589 phase A, first PR) 2026-05-29 19:09:44 +02:00