refactor(agent): move login-wait into login.rs, dedupe env resolvers
This commit is contained in:
parent
a3b66241d1
commit
bf93a81e1d
3 changed files with 238 additions and 242 deletions
|
|
@ -465,7 +465,7 @@ async fn serve_main<S: Surface>(socket: &Path, poll_ms: u64) -> Result<()> {
|
|||
}
|
||||
});
|
||||
if matches!(initial, LoginState::NeedsLogin) {
|
||||
turn::wait_for_login(&claude_dir, login_state.clone(), &bus, poll_ms).await;
|
||||
login::wait_for_login(&claude_dir, login_state.clone(), &bus, poll_ms).await;
|
||||
} else {
|
||||
// Clear any stale `hyperhive-needs-login` sentinel left over
|
||||
// from a prior boot — `online` status writes the sentinel
|
||||
|
|
@ -550,7 +550,7 @@ async fn serve_loop<S: Surface>(
|
|||
let ctrl = handle_turn::<S>(socket, &bus, stats.as_ref(), files, &turn_lock, next).await;
|
||||
if ctrl.auth_failed {
|
||||
*login_state.lock().unwrap() = LoginState::NeedsLogin;
|
||||
turn::wait_for_login(
|
||||
login::wait_for_login(
|
||||
&claude_dir,
|
||||
login_state.clone(),
|
||||
&bus,
|
||||
|
|
|
|||
Loading…
Reference in a new issue