Преглед на файлове

Remove the inert CHATTO_CHANNELS option

The field was declared and wizard-writable but never read: watching
always covered every joined room regardless. Drop it from
ChattoConfiguration, plugin.yaml, the setup wizard, tests and docs.
Room management moves to DM commands (/join //leave) in a follow-up.
Paul Klumpp преди 1 седмица
родител
ревизия
4cf4bf6d5f
променени са 5 файла, в които са добавени 3 реда и са изтрити 18 реда
  1. 1 7
      README.md
  2. 0 4
      adapter.py
  3. 0 1
      platform_config.py
  4. 0 4
      plugin.yaml
  5. 2 2
      test_adapter.py

+ 1 - 7
README.md

@@ -49,7 +49,7 @@ Capabilities natively implemented by the Chatto plugin adapter:
 
 1. **A running Chatto server** — self-hosted and accessible from the Hermes host. See the [Chatto repository](https://github.com/chattocorp/chatto) for installation instructions.
 2. **A Chatto user account** — the adapter logs in with a username and password (or token). Create a dedicated account for the bot (e.g., `hermes`).
-3. **Room membership** — the bot account must be a member of any room where you want it to respond. The adapter auto-joins rooms specified in `CHATTO_CHANNELS`. For DMs, simply start a direct message with the bot.
+3. **Room membership** — the bot account must be a member of any room where you want it to respond; the adapter watches every room the account has joined. For DMs, simply start a direct message with the bot.
 4. **Network access** — the Hermes host must reach the Chatto server URL over HTTPS (or HTTP) and establish a WebSocket connection to `/api/realtime`.
 
 > **Info:** The adapter uses WebSocket protocol v1 (compatible with Chatto v0.4.20+). Ensure your Chatto server is up to date.
@@ -90,9 +90,6 @@ CHATTO_BASE_URL=https://chat.example.com
 CHATTO_LOGIN=hermes
 CHATTO_PASSWORD=your-password
 
-# Optional: restrict to specific rooms (comma-separated room IDs)
-# CHATTO_CHANNELS=REljMv5Pgolo6Y9,abc123def456
-
 # Optional: home channel for cron/notification delivery
 # CHATTO_HOME_CHANNEL=REljMv5Pgolo6Y9
 
@@ -128,8 +125,6 @@ gateway:
       enabled: true
       extra:
         base_url: https://chat.example.com
-        channels:                  # room IDs to watch (empty = all joined)
-          - REljMv5Pgolo6Y9
         home_channel: REljMv5Pgolo6Y9
         require_mention: false     # only respond to @mentions in channels
         allowed_users: []          # empty = deny all (or set allow_all_users)
@@ -146,7 +141,6 @@ gateway:
 | `CHATTO_LOGIN` | Yes* | — | Chatto username (login) |
 | `CHATTO_PASSWORD` | Yes* | — | Chatto password |
 | `CHATTO_TOKEN` | No | — | Existing bearer token — alternative to login/password |
-| `CHATTO_CHANNELS` | No | All joined rooms | Comma-separated room IDs to watch |
 | `CHATTO_HOME_CHANNEL` | No | First watched room | Room ID for cron/notification delivery |
 | `CHATTO_ALLOWED_USERS` | No | _(deny all)_ | Comma-separated Chatto logins allowed to talk to the agent |
 | `CHATTO_ALLOW_ALL_USERS` | No | `false` | Allow any Chatto user to talk to the agent (`true`/`false`) |

+ 0 - 4
adapter.py

@@ -2067,10 +2067,6 @@ def hermes_setup_fn() -> None:
     if password:
         save_env_value(ChattoConfiguration.password.env_name, password)
 
-    channels = prompt("Room IDs to watch (comma-separated, or empty for all):")
-    if channels:
-        save_env_value(ChattoConfiguration.channels_list.env_name, channels)
-
     home = prompt("Home room ID for notifications (or empty):")
     if home:
         save_env_value(ChattoConfiguration.home_channel.env_name, home)

+ 0 - 1
platform_config.py

@@ -284,7 +284,6 @@ class ChattoConfiguration:
     token = ConfigField("str_opt")
     login = ConfigField("str")
     password = ConfigField("str")
-    channels_list = ConfigField("list", config_key="channels")
     home_channel = ConfigField("str")
     allowed_users = ConfigField("list")
     require_mention = ConfigField("bool", default=False)

+ 0 - 4
plugin.yaml

@@ -24,10 +24,6 @@ requires_env:
     prompt: "Chatto password"
     password: true
 optional_env:
-  - name: CHATTO_CHANNELS
-    description: "Comma-separated room IDs to watch (default: all joined rooms)"
-    prompt: "Room IDs (comma-separated)"
-    password: false
   - name: CHATTO_HOME_CHANNEL
     description: "Room ID for cron / notification delivery (defaults to the first watched room)"
     prompt: "Home room ID (or empty)"

+ 2 - 2
test_adapter.py

@@ -106,7 +106,7 @@ def _ensure_chatto_registered():
 
 _CHATTO_ENV_KEYS = [
     "CHATTO_BASE_URL", "CHATTO_LOGIN", "CHATTO_PASSWORD",
-    "CHATTO_CHANNELS", "CHATTO_HOME_CHANNEL",
+    "CHATTO_HOME_CHANNEL",
     "CHATTO_REQUIRE_MENTION", "CHATTO_ALLOWED_USERS",
     "CHATTO_ALLOW_ALL_USERS", "CHATTO_AUTO_THREAD",
     "CHATTO_REACTIONS",
@@ -125,7 +125,7 @@ def _clear_chatto_env(monkeypatch=None):
 def _make_config(**extra_overrides):
     """Create a minimal PlatformConfig for testing."""
     _ensure_chatto_registered()
-    extra = {"base_url": "https://chat.example.com", "channels": ["room1"]}
+    extra = {"base_url": "https://chat.example.com"}
     extra.update(extra_overrides)
     return PlatformConfig(enabled=True, extra=extra)