Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions changelog.d/coordinator-traffic-verdict.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### Say why a connected provider gets no coordinator work

- `darkbloom status` adds a `Traffic:` line and `darkbloom doctor` a `coordinator traffic` check. Either the coordinator can route work to this connection, or the line says why it cannot, with a fix: not connected; no coordinator verdict minutes after connecting (previously only `Trust: awaiting coordinator status`); App Attest authorization expired and not renewed; or the coordinator's reason for not authorizing it. Reasons include a locked login keychain, a stalled Apple App Attest call, App Attest unavailable on macOS 26 or outside a logged-in GUI session, and a connection without a linked account (`darkbloom login`). A connected Mac with a warm model no longer looks healthy while it receives nothing. Neither appears while an add-on holds the connected Mac: the hold, which `darkbloom status` reports on its own `Not serving:` line, is why no work arrives, not the connection's authorization.
- The daemon state file records the coordinator connection (`coordinator_connection`: connected, since when it has been up or down, and the registrations since the provider started). Failed reconnect attempts do not reset the time, so a long outage reads as one.
- The provider now re-registers a connection the coordinator has not authorized for 15–30 minutes (a random delay per process), then again after 30 minutes, 1 hour, 2 hours and every 4 hours while it stays unauthorized. It waits until the provider is idle: no accepted or local requests, model loads, Autopilot operation, drain or update. A new registration starts a new coordinator verification session, which clears coordinator states that previously needed a restart, such as verification that stopped after an unclassified failure or waits out an hourly retry. `darkbloom logs` shows when the coordinator stops or resumes routing work to the connection and each re-registration.
- `darkbloom status` adds a `Traffic:` line and `darkbloom doctor` a `coordinator traffic` check. Either the coordinator can route work to this connection, or the line says why it cannot, with a fix: not connected; no coordinator verdict minutes after connecting (previously only `Trust: awaiting coordinator status`); an `untrusted` or `offline` status; App Attest authorization expired and not renewed; or the coordinator's reason for not authorizing it. Reasons include a locked login keychain, a stalled Apple App Attest call, App Attest unavailable on macOS 26 or outside a logged-in GUI session, and a connection without a linked account (`darkbloom login`). A connected Mac with a warm model no longer looks healthy while it receives nothing. Neither appears while an add-on holds the connected Mac: the hold, which `darkbloom status` reports on its own `Not serving:` line, is why no work arrives, not the connection's authorization.
- Only current evidence says a connection gets no work. A refusal counts while it is at most 60 seconds old, as when the coordinator keeps repeating it, and not in the first 90 seconds after connecting. An older refusal reads `unconfirmed`, with its age and reason and no fix: the current coordinator sends no status when legacy verification authorizes a connection after the refusal it sends at registration, so legacy-verified Macs are never told they are excluded or need macOS 27. A request the coordinator routed after its latest status reads as eligible.
- The daemon state file records the coordinator connection (`coordinator_connection`: connected, since when it has been up or down, the registrations since the provider started, and `last_request_at`, when the coordinator last sent the connection a request). Failed reconnect attempts do not reset the time, so a long outage reads as one.
- The provider now re-registers a connection the coordinator keeps refusing for 15–30 minutes (a random delay per process), then again after 30 minutes, 1 hour, 2 hours and every 4 hours while the refusal stays current. A refusal sent once at registration never triggers it. It waits until the provider is idle: no accepted or local requests, model loads, Autopilot operation, drain or update. A new registration starts a new coordinator verification session, which clears coordinator states that previously needed a restart, such as verification that stopped after an unclassified failure or waits out an hourly retry. `darkbloom logs` shows when the coordinator starts refusing the connection, when it authorizes it, when its refusal is no longer current, and each re-registration.
26 changes: 18 additions & 8 deletions docs/provider/cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1042,14 +1042,24 @@ Output includes:
holds with each hold's UTC expiry and time left. `Not evictable for a load
now` lists the resident models no load can evict at the snapshot, with the
same reasons a refusal gives (`provider-swift/Sources/darkbloom/StatusCommand+Residency.swift`).
- `Traffic:` whether the coordinator can route work to this connection. `eligible
for coordinator work` names the App Attest lease or legacy verification;
`NOT receiving coordinator work:` names the cause with a `→ fix:` line
(disconnected, with how long the connection has been down across failed
reconnect attempts, no coordinator verdict 90 seconds after connecting, an expired
lease, or the coordinator's reason, such as a locked login keychain, a stalled
Apple call, App Attest unavailable on macOS 26 or outside a logged-in GUI
session, or a connection without a linked account). Omitted while a drain line
- `Traffic:` whether the coordinator can route work to this connection, judged
from current evidence only; the provider re-registers on the same verdict.
`eligible for coordinator work` names the App Attest lease or legacy
verification, or a request the coordinator routed after its latest status
(`received a coordinator request … ago`; state field
`coordinator_connection.last_request_at`). `not yet eligible` covers the first
90 seconds after connecting (`statusGraceSeconds`) while the coordinator has
sent no status or one that does not authorize the connection yet.
`NOT receiving coordinator work:` names the cause with a `→ fix:` line:
disconnected, with how long the connection has been down across failed
reconnect attempts; no coordinator status 90 seconds after connecting; an
`untrusted` or `offline` status; an expired lease; or a refusal received in the
last 60 seconds (`refusalMaxAge`) with the coordinator's reason, such as a
locked login keychain, a stalled Apple call, App Attest unavailable on macOS 26
or outside a logged-in GUI session, or a connection without a linked account.
An older refusal reads `unconfirmed`, with its age and reason and no fix: the
current coordinator sends no status when legacy verification authorizes a
connection after the refusal it sends at registration. Omitted while a drain line
Comment thread
Gajesh2007 marked this conversation as resolved.
Resolved
is shown, while an add-on holds a connected Mac (its
`Not serving: held by add-on` line says why no work arrives), for a stale
snapshot, and for daemons that predate the `coordinator_connection` state field
Expand Down
4 changes: 2 additions & 2 deletions docs/provider/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ App Attest, attestation readiness, trust, model fit, runtime, billing, version;
| `coordinator health`, `minimum version`, `coordinator trust` | Coordinator reachable, this version is accepted, trust verdict with reasons | `darkbloom update`; reasons are explained in [attestation](./attestation.md) |
| `trust level` stuck at `self_signed` | The MDM `SecurityInfo` cross-check has not passed for this connection | `darkbloom enroll` if not enrolled; otherwise wait — see [Reaching and keeping `hardware` trust](./attestation.md#troubleshooting) |
| `daemon`, `daemon connected`, `daemon state freshness` | Daemon process alive, WebSocket connected, snapshot refreshed | See [service lifecycle](#the-service-does-not-stay-running); a stale snapshot ⇒ `darkbloom restart` |
| `coordinator traffic` | Whether the coordinator can route work to this connection: connected, a coordinator verdict received, and an App Attest lease or legacy authorization current. ✗ names the cause: disconnected, no verdict minutes after connecting, an expired lease, or the coordinator's reason for not authorizing it. Skipped while an add-on holds the connected Mac on purpose: `darkbloom status` prints `Not serving: held by add-on …` and `darkbloom addon` shows the hold (`provider-swift/Sources/ProviderCore/Diagnostics/ServingReadiness.swift`) | Follow the printed fix. A locked login keychain, a stalled Apple call or a provider started outside the logged-in GUI session clears after logging in at the console or `darkbloom restart`; `app_attest_identity_required` needs `darkbloom login`; macOS 26 needs macOS 27 unless the Mac is in the legacy MDM cohort. See [connected but no traffic](#coordinator-connection) |
| `coordinator traffic` | Whether the coordinator can route work to this connection: connected, a coordinator verdict received, and an App Attest lease, legacy authorization or a request routed since the latest status. ✗ names the cause from current evidence only: disconnected, no verdict minutes after connecting, an `untrusted` or `offline` status, an expired lease, or a refusal received in the last minute with the coordinator's reason. ℹ `unconfirmed`: the last refusal is older than that, so it does not show an exclusion; the current coordinator sends no status when legacy verification authorizes a connection after its registration refusal. Skipped while an add-on holds the connected Mac on purpose: `darkbloom status` prints `Not serving: held by add-on …` and `darkbloom addon` shows the hold (`provider-swift/Sources/ProviderCore/Diagnostics/ServingReadiness.swift`) | Follow the printed fix. A locked login keychain, a stalled Apple call or a provider started outside the logged-in GUI session clears after logging in at the console or `darkbloom restart`; `app_attest_identity_required` needs `darkbloom login`; macOS 26 needs macOS 27 unless the Mac is in the legacy MDM cohort. `unconfirmed` prints no fix: its reason is the coordinator's last, which may no longer apply. See [connected but no traffic](#coordinator-connection) |
| `recent model load` | Last model-load error recorded by the daemon | See [models and memory](#models-and-memory) |
| `kv backend posture`, `kv backend crash-loop guard` | Explicit `engine_v2_kv_backend` request honoured; guard record present | See [KV-backend guard](#kv-backend-crash-loop-guard) |
| `competing inference` | Another inference server holds the GPU (`provider-swift/Sources/darkbloom/Diagnostics/CompetingInferenceDiagnostics.swift`) | Quit it; it competes for the same unified memory and GPU time |
Expand Down Expand Up @@ -140,7 +140,7 @@ tail -50 ~/.darkbloom/provider.log ~/.darkbloom/watchdog.log
|---|---|---|
| `daemon connected` ⚠, console shows offline | The client reconnects with an exponential backoff (`ExponentialBackoff`, `provider-swift/Sources/ProviderCore/Coordinator/CoordinatorClient+Connection.swift`; bounds in [runtime constants](./cli-reference.md#runtime-constants)) | `curl -v https://api.darkbloom.dev/health`; check DNS, clock, TLS interception, firewall on 443 |
| Log: `WebSocket pong timeout (no response in 30s)` | No pong within `pongTimeout` of a `pingInterval` ping closes the socket and the backoff restarts it ([runtime constants](./cli-reference.md#runtime-constants)) | Network path stalls; nothing to configure on the provider |
| Heartbeats arrive but requests do not ("no traffic until restart") | A heartbeat every `heartbeat_interval_secs` proves the connection, not routability. The coordinator routes only a connection it authorizes (an App Attest lease or legacy verification) | `darkbloom status` → `Traffic:` and `darkbloom doctor` → `coordinator traffic` name the cause and fix. The provider re-registers a connection the coordinator has not authorized for 15–30 minutes, then after 30 minutes, 1 hour, 2 hours and every 4 hours while it stays unauthorized, only while it is idle: no accepted or local requests, model loads, Autopilot operation, drain or update (`provider-swift/Sources/ProviderCore/Coordinator/UnauthorizedConnectionRecovery.swift`, `provider-swift/Sources/ProviderCore/ProviderLoop+ServingAuthorizationRecovery.swift`), and `darkbloom logs` records when routing stops or resumes. The routing gates are listed in [`../architecture/security/attestation.md#routing-gate`](../architecture/security/attestation.md#routing-gate) |
| Heartbeats arrive but requests do not ("no traffic until restart") | A heartbeat every `heartbeat_interval_secs` proves the connection, not routability. The coordinator routes only a connection it authorizes (an App Attest lease or legacy verification) | `darkbloom status` → `Traffic:` and `darkbloom doctor` → `coordinator traffic` name the cause and fix. The provider re-registers a connection while that verdict stays `NOT receiving` for 15–30 minutes, then after 30 minutes, 1 hour, 2 hours and every 4 hours, only while it is idle: no accepted or local requests, model loads, Autopilot operation, drain or update (`provider-swift/Sources/ProviderCore/Coordinator/UnauthorizedConnectionRecovery.swift`, `provider-swift/Sources/ProviderCore/ProviderLoop+ServingAuthorizationRecovery.swift`). A refusal counts only while the coordinator keeps repeating it, so a refusal sent once at registration never triggers a re-registration. `darkbloom logs` records when the coordinator starts refusing the connection, when it authorizes it, and when its refusal is no longer current. The routing gates are listed in [`../architecture/security/attestation.md#routing-gate`](../architecture/security/attestation.md#routing-gate) |
| `minimum version` ✗ | Coordinator rejects this `ProviderCore.version` | `darkbloom update` |
| `Requests served` in `status` is higher than the jobs in the console's Earnings | The status count covers only the time since the daemon started (the `… ago` on the line) and includes requests that ended early on a coordinator cancel or a dropped connection, which the coordinator may not pay for, and free [self-route](./self-route.md) requests to your own machine. Earnings lists only paid jobs (`provider-swift/Sources/darkbloom/StatusCommand+ServedRequests.swift`) | Compare Earnings over the same period; the machine card's Tokens/reqs add the status counters up across restarts |

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import Foundation

/// When to re-register a connection the coordinator keeps refusing to route.
/// "Refusing" is the blocked `ServingReadiness` verdict that `status` and
/// `doctor` show, so only current evidence counts: a refusal the coordinator
/// stopped repeating does not.
///
/// A new registration starts a new coordinator verification session. That
/// clears coordinator-side states only a reconnect clears: a verification
Expand Down Expand Up @@ -34,17 +37,4 @@ enum UnauthorizedConnectionRecovery {
let doublings = min(max(attempts - 1, 0), 8)
return min(firstRetryInterval * pow(2, Double(doublings)), maximumRetryInterval)
}

/// Whether the coordinator's latest status says this connection may not be
/// routed: an explicit `none` path, an expired App Attest lease, or no
/// status long after registering. A status without an authorization object
/// (a coordinator without App Attest serving) is not judged.
static func connectionLacksAuthorization(
connectedAt: Double, trust: DaemonState.Trust?, now: Double
) -> Bool {
guard let trust else { return now - connectedAt >= ServingReadiness.statusGraceSeconds }
if trust.status == "untrusted" || trust.status == "offline" { return true }
guard let authorization = trust.authorization else { return false }
return !authorization.hasCurrentAppAttestAuthorization(now: now) && authorization.path != "legacy"
}
}
Loading
Loading