A provider MSP client workspace is a tenant organization of a hosted
runtime. Settings > Infrastructure minted its agent install tokens into the
org's own config copy (configapi getContextState). Agents never send
X-Pulse-Org-ID, so auth only looks them up in the instance inventory and
routes them by the token's org binding. Every agent installed from a client
workspace got 401 on every report, on v6.5.0 and v6.6.0, so a provider's
first client never received data.
The control plane's hosted install command already stored org-bound tokens
in the instance inventory, but bridged the tenant monitor with an
in-memory copy that agent removal revoked alone, that a tenant reload
dropped, and that diverged from the instance record. Store a tenant org's
tokens only in the instance inventory, from both paths, and let the tenant
monitor read them through Monitor.APITokenInventories: its own config, then
the instance records bound only to its org. Proxmox bootstrap and
auto-register, install-time command policy, Connections, Agent Doctor and
removal revocation now act on the record where it lives. Own config comes
first so a duplicate an earlier version persisted keeps its grant state,
and revocation commits in every inventory or in none. The default org and
single-runtime installs keep one inventory and are unchanged.
Tokens minted in a tenant org before this fix stay in the org copy and
still cannot authenticate; regenerating the install command fixes them.
The hosted-tenant mint site (GenerateHostedTenantAgentInstallCommand)
issued binding-eligible install tokens without the command_policy_intent
metadata that 87ee3cd44 added to the self-hosted mint sites, so a hosted
tenant reinstalling an agent never got the stale-disabled-policy
reconciliation on first report (#1728). Hosted installs have no
enableCommands toggle, so the intent follows the install type the same
way the self-hosted flow does: pve enabled, pbs disabled.