pub(crate) fn stale_sign_in_reason(
broker: Option<&CredentialState>,
creds: &MuxBusCredentials,
discovered: Option<&CloudSettings>,
) -> Option<String>Expand description
Why the stored AgentMux Cloud sign-in can’t work anymore, or None if it
still can (docs/specs/SPEC_CLOUD_SETTINGS_DISCOVERY_2026_09_27.md §3.3).
Stale means only a new sign-in helps:
- the cloud publishes a different desktop client id than the one the credential was issued to (it belongs to a user pool the cloud has left);
- or the broker’s refresh was refused outright (
NeedsReauthwithrejected), and the stored token isn’t fresh. A fresh one means someone signed in since, possibly from another channel sharing the store; the broker catches up on its next check.
Transient failures that merely piled up into NeedsReauth are not stale:
the network coming back can still cure them.