Skip to content

Your lightweight open-source personal agent.

fix: remove duplicate import, tidy MatrixConfig comments

Re-bin12f3365103c4
diff --git a/nanobot/config/schema.py b/nanobot/config/schema.py
index 4889783aa..1ff9782f2 100644
--- a/nanobot/config/schema.py
+++ b/nanobot/config/schema.py
@@ -6,7 +6,6 @@ from typing import Literal
from pydantic import BaseModel, Field, ConfigDict
from pydantic.alias_generators import to_camel
from pydantic_settings import BaseSettings
-from typing import Literal
class Base(BaseModel):
@@ -187,18 +186,14 @@ class QQConfig(Base):
class MatrixConfig(Base):
"""Matrix (Element) channel configuration."""
-
enabled: bool = False
homeserver: str = "https://matrix.org"
access_token: str = ""
- user_id: str = "" # @bot:matrix.org
+ user_id: str = "" # e.g. @bot:matrix.org
device_id: str = ""
- # Enable Matrix E2EE support (encryption + encrypted room handling).
- e2ee_enabled: bool = True
- # Max seconds to wait for sync_forever to stop gracefully before cancellation fallback.
- sync_stop_grace_seconds: int = 2
- # Max attachment size accepted for Matrix media handling (inbound + outbound).
- max_media_bytes: int = 20 * 1024 * 1024
+ e2ee_enabled: bool = True # end-to-end encryption support
+ sync_stop_grace_seconds: int = 2 # graceful sync_forever shutdown timeout
+ max_media_bytes: int = 20 * 1024 * 1024 # inbound + outbound attachment limit
allow_from: list[str] = Field(default_factory=list)
group_policy: Literal["open", "mention", "allowlist"] = "open"
group_allow_from: list[str] = Field(default_factory=list)