Ben
c93b9f9057
feat(relay): terminal 4401 (opt-out) → clean "Relay disabled" state
...
Phase 7 Unit 7d-B. When an operator opts an instance OUT of the Team Gateway
relay (Unit 7b deprovision), the connector revokes the per-gateway secret and
closes the gateway's WS with 4401. The reconnect supervisor previously treated
EVERY close as retryable, so the live process spun "retrying 4401" forever and
the dashboard showed a red error — opt-out looked like a failure.
Now a 4401 close that arrives AFTER a successful handshake is recognized as a
terminal credential revocation:
- ws_transport.py: track `_handshake_succeeded` (set when a descriptor is
received); on a 4401 close after a prior success, latch `auth_revoked` and do
NOT spawn the reconnect supervisor. A 4401 BEFORE any successful handshake
stays retryable (cold-start / not-yet-provisioned race, not a revocation).
New `auth_revoked` property + a websockets-version-safe close-code reader
(prefers `.rcvd`/`.sent` Close frames; `.code` is deprecated in websockets 13+).
- adapter.py: a revocation monitor turns `transport.auth_revoked` into a clean,
NON-retryable `relay_disabled` fatal and notifies the gateway's fatal-error
handler (so the adapter is removed and NOT queued for reconnection — the
credential is dead until the instance is recreated). Monitor is cancelled on
disconnect; only started when the transport exposes `auth_revoked` (prod WS).
- run.py: `_handle_adapter_fatal_error` maps the `relay_disabled` code to a
`disabled` platform_state (not `fatal`/`retrying`).
- web: PlatformsCard renders the `disabled` state with a neutral outline badge,
a PowerOff icon, and muted (not destructive-red) text + message. New optional
`status.disabled` i18n string ("Disabled").
Also bundles the Phase 7 contract-doc update (this doc is authoritative in
hermes-agent): docs/relay-connector-contract.md gains an "Author-first
resolution + the account-link (DM) path" section documenting the
multi-tenant-guild rule (D-7.2 — route by authenticated author binding, never by
guild; unlinked → fail-closed), the `/link <code>` DM flow, and the
connector-authoritative opt-out + terminal-4401 behavior this PR implements.
Tests: +2 ws_transport (4401-after-handshake terminal / no-reconnect;
4401-before-handshake stays retryable) and +2 adapter (revocation → non-retryable
relay_disabled fatal + handler fired; no-revocation → no fatal). 138 relay tests
pass (incl. the contract-doc conformance test); ruff clean; web tsc clean.
Phase 7 Unit 7d-B (relay-adapter solo lane). Q17 → Option 2; Option 3 (live
de-register, no recreate) + the restart-re-provision hole deferred post-alpha.
2026-06-24 18:43:01 +10:00
..
2026-05-20 13:00:57 -07:00
2026-06-24 18:43:01 +10:00
2026-02-26 03:20:08 +03:00
2026-04-30 01:19:34 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-10 14:01:34 +10:00
2026-05-28 22:26:25 -07:00
2026-06-21 11:57:15 -07:00
2026-06-13 06:38:29 -07:00
2026-06-08 11:29:53 -07:00
2026-06-06 09:00:10 -07:00
2026-06-16 03:35:24 +05:30
2026-06-20 10:26:45 -07:00
2026-05-17 02:29:41 -07:00
2026-05-28 22:26:25 -07:00
2026-06-07 10:04:57 -07:00
2026-04-20 04:16:13 -07:00
2026-06-14 03:25:49 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-21 07:26:03 -07:00
2026-06-22 11:39:45 +00:00
2026-05-28 22:26:25 -07:00
2026-06-21 12:15:14 -07:00
2026-05-28 22:26:25 -07:00
2026-06-19 16:59:58 -07:00
2026-06-07 18:05:58 -07:00
2026-06-02 16:55:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-24 01:31:45 -07:00
2026-06-01 18:52:05 -07:00
2026-05-18 21:38:05 -07:00
2026-06-21 11:35:09 -07:00
2026-05-28 22:26:25 -07:00
2026-06-19 06:31:13 -07:00
2026-04-19 01:48:42 -07:00
2026-06-15 05:51:47 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-04-23 19:38:33 -05:00
2026-05-18 10:19:40 -07:00
2026-04-24 02:55:43 -07:00
2026-04-24 02:55:43 -07:00
2026-06-08 06:32:23 -07:00
2026-06-13 04:51:59 -07:00
2026-06-07 22:39:51 -07:00
2026-06-14 03:20:21 -07:00
2026-06-20 10:26:45 -07:00
2026-05-24 01:31:45 -07:00
2026-06-21 22:43:57 -07:00
2026-06-23 23:39:22 -07:00
2026-04-22 11:59:39 -07:00
2026-05-29 19:06:05 -07:00
2026-06-22 05:41:22 -07:00
2026-05-09 11:04:46 -07:00
2026-06-20 10:26:45 -07:00
2026-04-24 03:04:42 -07:00
2026-05-22 14:21:41 -07:00
2026-05-22 14:21:41 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-22 14:21:41 -07:00
2026-05-22 14:21:41 -07:00
2026-05-28 22:26:25 -07:00
2026-06-19 06:31:08 -07:00
2026-06-23 23:55:18 -07:00
2026-06-11 15:39:01 -04:00
2026-06-21 22:43:45 -07:00
2026-06-24 03:25:33 +05:30
2026-06-19 12:03:08 -07:00
2026-05-22 14:21:41 -07:00
2026-05-28 22:26:25 -07:00
2026-05-22 14:21:41 -07:00
2026-06-10 00:24:06 -07:00
2026-05-27 03:35:33 -07:00
2026-05-22 14:21:41 -07:00
2026-05-22 14:21:41 -07:00
2026-05-22 14:21:41 -07:00
2026-05-28 22:26:25 -07:00
2026-05-22 14:21:41 -07:00
2026-05-22 14:21:41 -07:00
2026-06-14 17:02:21 +07:00
2026-06-22 13:58:33 -07:00
2026-05-17 02:29:41 -07:00
2026-05-28 22:26:25 -07:00
2026-06-05 03:10:40 -07:00
2026-06-23 10:44:02 -07:00
2026-06-20 10:26:45 -07:00
2026-06-21 22:43:45 -07:00
2026-06-11 11:58:19 -07:00
2026-05-28 22:26:25 -07:00
2026-06-21 13:33:52 -07:00
2026-05-30 07:28:06 -07:00
2026-05-30 18:58:46 -07:00
2026-05-30 07:38:03 -07:00
2026-05-28 22:26:25 -07:00
2026-06-16 15:49:59 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-04-30 20:30:31 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-05-28 22:26:25 -07:00
2026-05-27 02:41:24 -07:00
2026-06-23 23:29:28 -07:00
2026-05-28 22:26:25 -07:00
2026-06-10 14:01:34 +10:00
2026-06-14 03:25:08 -07:00
2026-05-07 06:31:08 -07:00
2026-05-07 17:33:09 -07:00
2026-06-22 06:27:29 -07:00
2026-06-04 16:54:40 -07:00
2026-05-03 08:47:49 -07:00
2026-06-06 11:46:24 -07:00
2026-05-28 22:26:25 -07:00
2026-04-15 17:54:16 -07:00
2026-06-21 11:11:23 -07:00
2026-06-20 10:57:41 -07:00
2026-05-24 01:31:45 -07:00
2026-05-28 22:26:25 -07:00
2026-06-21 12:43:44 -07:00
2026-06-01 20:30:24 -07:00
2026-05-28 22:26:25 -07:00
2026-06-19 07:35:33 -07:00
2026-06-12 12:02:41 -07:00
2026-06-04 21:55:20 -07:00
2026-05-28 22:26:25 -07:00
2026-05-24 15:03:27 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-23 23:57:38 -07:00
2026-06-20 21:22:11 -07:00
2026-06-23 23:57:38 -07:00
2026-06-16 06:34:54 -07:00
2026-06-08 15:12:12 -07:00
2026-06-05 09:10:26 -07:00
2026-05-26 14:28:51 -07:00
2026-06-21 11:56:46 -07:00
2026-06-20 23:20:16 -07:00
2026-06-20 10:26:45 -07:00
2026-05-16 12:55:23 -07:00
2026-05-28 22:26:25 -07:00
2026-06-16 15:49:59 -07:00
2026-05-28 22:26:25 -07:00
2026-04-10 03:07:00 -07:00
2026-06-21 13:33:23 -07:00
2026-06-19 07:07:06 -07:00
2026-06-19 19:58:26 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-19 07:34:15 -07:00
2026-06-19 07:34:15 -07:00
2026-06-19 07:34:15 -07:00
2026-06-19 07:34:15 -07:00
2026-06-19 07:34:15 -07:00
2026-04-30 20:26:35 -07:00
2026-05-01 13:33:06 -07:00
2026-06-12 08:51:10 +00:00
2026-05-29 13:17:46 -07:00
2026-05-28 22:26:25 -07:00
2026-04-30 05:00:25 -07:00
2026-04-18 19:32:26 -07:00
2026-04-19 03:03:57 -07:00
2026-06-02 05:52:54 -07:00
2026-04-10 03:44:43 -07:00
2026-05-29 17:36:58 +00:00
2026-06-23 02:56:48 +05:30
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-02 17:27:44 -07:00
2026-06-23 21:33:10 -07:00
2026-05-28 22:26:25 -07:00
2026-04-29 21:56:51 -07:00
2026-05-07 05:04:37 -07:00
2026-04-24 03:02:03 -07:00
2026-05-28 22:26:25 -07:00
2026-06-06 18:44:44 -07:00
2026-06-03 20:25:17 +08:00
2026-06-19 07:52:37 -07:00
2026-06-21 20:21:11 -07:00
2026-06-17 16:37:45 -07:00
2026-04-29 21:07:47 -07:00
2026-05-22 14:21:41 -07:00
2026-05-28 22:26:25 -07:00
2026-06-20 15:16:53 +05:30
2026-06-14 03:25:08 -07:00
2026-06-10 23:22:43 -07:00
2026-06-08 01:25:35 -07:00
2026-05-28 22:26:25 -07:00
2026-06-19 16:59:58 -07:00
2026-06-24 00:14:25 -07:00
2026-06-15 07:46:34 -07:00
2026-05-20 13:00:57 -07:00
2026-03-10 23:34:52 -07:00
2026-05-27 05:21:53 -07:00
2026-05-28 22:26:25 -07:00
2026-06-12 12:02:41 -07:00
2026-05-30 07:38:03 -07:00
2026-05-15 14:32:14 -07:00
2026-06-24 16:34:51 +10:00
2026-04-26 07:15:23 -07:00
2026-06-03 23:51:44 -06:00
2026-06-19 06:31:13 -07:00
2026-04-28 06:50:04 -07:00
2026-05-08 18:50:25 -07:00
2026-06-21 12:34:22 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-04-04 19:05:34 -07:00
2026-05-18 22:25:15 -07:00
2026-06-16 15:49:59 -07:00
2026-06-03 06:36:46 -07:00
2026-05-09 14:18:20 +03:00
2026-05-28 22:26:25 -07:00
2026-06-19 18:06:38 -04:00
2026-06-21 08:26:19 -07:00
2026-05-28 22:26:25 -07:00
2026-04-26 18:49:48 -07:00
2026-05-23 02:25:53 -07:00
2026-04-26 19:01:50 -07:00
2026-06-07 22:10:32 -07:00
2026-05-27 02:41:24 -07:00
2026-05-28 22:26:25 -07:00
2026-06-24 03:06:21 +05:30
2026-06-04 07:50:45 -07:00
2026-06-23 23:56:36 -07:00
2026-06-21 15:23:36 -07:00
2026-06-20 10:26:45 -07:00
2026-04-21 00:54:46 -07:00
2026-06-08 15:12:12 -07:00
2026-05-10 09:01:51 -07:00
2026-04-27 06:41:16 -07:00
2026-06-20 13:47:14 +05:30
2026-05-28 22:26:25 -07:00
2026-06-20 21:00:46 +05:30
2026-06-12 01:07:50 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-22 09:44:52 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-23 14:44:12 +05:30
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-20 10:26:45 -07:00
2026-05-28 22:26:25 -07:00
2026-06-07 02:15:23 -07:00
2026-05-28 22:26:25 -07:00
2026-06-21 16:41:17 -07:00
2026-06-15 07:46:34 -07:00
2026-06-23 23:29:28 -07:00
2026-04-18 04:17:18 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-31 09:29:03 -07:00
2026-06-13 13:44:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-21 13:55:50 -07:00
2026-06-02 00:33:50 -07:00
2026-06-09 23:16:23 -07:00
2026-05-28 22:26:25 -07:00
2026-06-20 20:05:37 -07:00
2026-05-08 11:18:14 -07:00
2026-06-19 16:20:59 -07:00
2026-06-20 10:26:45 -07:00
2026-06-11 11:58:19 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-24 02:15:47 +05:30
2026-06-20 10:26:45 -07:00
2026-06-21 22:43:45 -07:00
2026-06-24 00:00:46 -07:00
2026-06-20 10:26:45 -07:00
2026-06-21 22:43:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-05-27 02:41:24 -07:00
2026-06-20 10:26:45 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-22 12:29:05 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-21 12:03:24 -07:00
2026-06-21 08:26:28 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-05-28 23:25:52 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 01:54:16 +05:30
2026-06-01 17:31:32 -07:00
2026-05-28 22:26:25 -07:00
2026-06-16 06:34:54 -07:00
2026-06-23 03:14:18 +05:30
2026-06-21 22:43:57 -07:00
2026-05-02 02:00:09 -07:00
2026-06-01 02:04:14 -07:00
2026-04-22 16:23:21 -07:00
2026-06-12 13:42:42 -04:00
2026-06-04 06:56:28 -07:00
2026-06-08 01:25:35 -07:00
2026-05-28 22:26:25 -07:00
2026-06-05 18:05:05 -07:00
2026-06-13 03:33:27 -07:00
2026-04-27 12:37:33 -07:00
2026-06-10 02:57:39 -07:00
2026-05-28 22:26:25 -07:00
2026-06-21 19:05:27 -07:00
2026-06-14 02:40:54 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-04-19 22:45:08 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-07 21:50:57 -07:00
2026-06-07 22:10:17 -07:00
2026-06-20 17:05:27 -07:00
2026-06-21 17:23:33 -07:00
2026-06-11 07:51:01 -07:00
2026-06-21 17:23:33 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-21 13:32:22 -07:00
2026-06-20 10:26:45 -07:00
2026-04-13 16:32:04 -07:00