Watch
0
0
Fork
You've already forked hyperhive
0

hive-agent: correct doc comments that describe sentinel files, session flags and outcomes the code no longer has

This commit is contained in:
damocles 2026-10-21 22:13:54 +02:00 • committed by mara
commit ac0bed47e9

View file

@ -75,7 +75,7 @@ pub struct ClearedSession {
/// Delete the credential files (see [`CRED_FILE_NAMES`]) from `dir`, forcing a
/// re-login on the next turn, while preserving the session-history files
/// alongside them so `claude --continue` keeps working after a fresh login.
/// alongside them so the session resumed by title survives a fresh login.
/// Idempotent: an already-absent file is skipped, not reported. This is the
/// write-side counterpart to [`has_session`]; `/logout` (`web_ui::auth`) drives
/// it.
@ -165,13 +165,12 @@ pub async fn wait_for_login(
claude_dir = %claude_dir.display(),
"no claude session — staying in partial-run mode (web UI only)"
);
// Announce `needs_login_idle` to the bus so the sentinel file
// (`{state_dir}/hyperhive-needs-login`) gets written on every entry
// path — cold-boot, 401-mid-turn, and `/api/logout`. The host's
// `auth_failed_sentinel` reads that file to surface `needs_login`
// on the dashboard. Idempotent — `emit_status` is a `write` on a
// small empty file, so re-entering this function after a transient
// operator action is a no-op for the on-disk state.
// Announce `needs_login_idle` to the bus so
// `hyperhive-harness.json` records it on every entry path —
// cold-boot, 401-mid-turn, and `/api/logout`. The host reads that
// file to surface `needs_login` on the dashboard. Idempotent —
// re-entering this function after a transient operator action
// rewrites the same on-disk state.
bus.emit_status("needs_login_idle");
// Baseline for the unreadable-mtime fallback in `has_fresh_credentials`
// — captured once, here, not recomputed per poll. See that fn's doc