chore(phase-a): aria.env + OpenClaw-specific configs raus, Brain-Backup angelegt
Vorbereitung fuer Bridge-als-Agent (OpenClaw raus). Phase-A-Cleanup: - aria-data/brain-import/ angelegt — System-Prompt-Files BOOTSTRAP.md + AGENT.md + USER.md.example + TOOLING.md.example dort archiviert. Werden vom neuen Agent-Framework spaeter importiert. - aria-data/config/aria.env + .example geloescht (alle Eintraege waren tot oder via runtime.json/Hardcode-Default abgedeckt) - aria-data/config/openclaw.env + openclaw-auth.json geloescht (Provider-Config landet im Bridge-Code) - docker-compose: AGENT/BOOTSTRAP/USER/openclaw.env-Mounts aus aria-core raus; aria.env-Mount aus bridge raus; COMPACT_AFTER_MESSAGES env raus (kommt jetzt aus runtime.json) - bridge: CONFIG_PATH-Lesen aus /config/aria.env entfernt, load_config nutzt nur noch runtime.json; _compact_after liest compactAfterMessages aus runtime.json (Default 140) - diagnostic: Eingabefeld "Compact nach Messages" in Runtime-Config-UI; load/save schreiben/lesen compactAfterMessages - init.sh: nur noch .env-Bootstrap (Rest landet eh in runtime.json/DB) ARIA antwortet im Phase-A-Status ohne ihre Persoenlichkeit (System-Prompt nicht mehr gemountet, "raw Claude" durch Proxy) — das ist Absicht und Uebergang bis das neue Gehirn live ist. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+16
-27
@@ -48,7 +48,6 @@ logger = logging.getLogger("aria-bridge")
|
||||
|
||||
# ── Konfiguration ───────────────────────────────────────────
|
||||
|
||||
CONFIG_PATH = Path("/config/aria.env")
|
||||
VOICES_DIR = Path("/voices")
|
||||
CORE_WS_URL = os.getenv("ARIA_CORE_WS", "ws://127.0.0.1:18789")
|
||||
CORE_AUTH_TOKEN = os.getenv("ARIA_AUTH_TOKEN", "") # OpenClaw Gateway Token
|
||||
@@ -68,38 +67,22 @@ BLOCK_SIZE = 1280 # 80ms bei 16kHz — gut fuer Wake-Word-Erkennung
|
||||
RECORD_SECONDS = 8 # Max. Aufnahmedauer nach Wake-Word
|
||||
|
||||
def load_config() -> dict[str, str]:
|
||||
"""Laedt Konfiguration.
|
||||
|
||||
Reihenfolge (hoechste Prioritaet zuletzt):
|
||||
1. /config/aria.env (bind-mount)
|
||||
2. /shared/config/runtime.json (zentral gepflegt ueber Diagnostic UI)
|
||||
|
||||
Werte aus runtime.json ueberschreiben die env-Datei.
|
||||
"""Laedt Konfiguration ausschliesslich aus /shared/config/runtime.json
|
||||
(zentral gepflegt ueber Diagnostic UI). Tokens + RVS-Settings kommen
|
||||
via ENV (siehe docker-compose).
|
||||
"""
|
||||
config: dict[str, str] = {}
|
||||
if CONFIG_PATH.exists():
|
||||
for line in CONFIG_PATH.read_text().splitlines():
|
||||
line = line.strip()
|
||||
if not line or line.startswith("#"):
|
||||
continue
|
||||
if "=" in line:
|
||||
key, _, value = line.partition("=")
|
||||
config[key.strip()] = value.strip()
|
||||
logger.info("Konfiguration geladen aus %s", CONFIG_PATH)
|
||||
else:
|
||||
logger.warning("Keine Konfiguration gefunden: %s", CONFIG_PATH)
|
||||
|
||||
# Runtime-Overrides aus zentralem Shared-Volume (Diagnostic UI)
|
||||
runtime_path = Path("/shared/config/runtime.json")
|
||||
if runtime_path.exists():
|
||||
try:
|
||||
runtime = json.loads(runtime_path.read_text())
|
||||
overrides = {k: str(v) for k, v in runtime.items() if v not in (None, "")}
|
||||
if overrides:
|
||||
config.update(overrides)
|
||||
logger.info("Runtime-Overrides geladen: %s", sorted(overrides.keys()))
|
||||
config = {k: str(v) for k, v in runtime.items() if v not in (None, "")}
|
||||
if config:
|
||||
logger.info("Runtime-Config geladen: %s", sorted(config.keys()))
|
||||
except Exception as e:
|
||||
logger.warning("runtime.json konnte nicht gelesen werden: %s", e)
|
||||
else:
|
||||
logger.info("Keine runtime.json — Diagnostic schreibt sie beim ersten Konfigurieren")
|
||||
return config
|
||||
|
||||
|
||||
@@ -554,7 +537,13 @@ class ARIABridge:
|
||||
# COMPACT_AFTER erreicht → Sessions reset + Container restart.
|
||||
# Counter ueberlebt Bridge-Restart nicht (frischer Zaehler beim Start ok).
|
||||
self._user_message_count: int = 0
|
||||
self._compact_after = int(os.getenv("COMPACT_AFTER_MESSAGES", "140"))
|
||||
# Aus runtime.json gelesen (Diagnostic → Einstellungen → Compact-Schwelle)
|
||||
# Default 140, 0 = deaktiviert
|
||||
try:
|
||||
rt = json.loads(Path("/shared/config/runtime.json").read_text()) if Path("/shared/config/runtime.json").exists() else {}
|
||||
self._compact_after = int(rt.get("compactAfterMessages", 140))
|
||||
except Exception:
|
||||
self._compact_after = 140
|
||||
# Pending Files: wenn die App ein Bild + Text gleichzeitig schickt, kommen
|
||||
# zwei separate RVS-Events ('file' und 'chat') — wir buffern die Files
|
||||
# kurz und mergen sie mit dem nachfolgenden Chat-Text zu einer einzigen
|
||||
@@ -598,7 +587,7 @@ class ARIABridge:
|
||||
logger.info("RVS: %s (Token: %s...)", self.rvs_url, self.rvs_token[:8])
|
||||
else:
|
||||
logger.warning("RVS nicht konfiguriert — App-Verbindung deaktiviert")
|
||||
logger.warning(" Setze RVS_HOST, RVS_PORT, RVS_TOKEN in /config/aria.env")
|
||||
logger.warning(" Setze RVS_HOST, RVS_PORT, RVS_TOKEN in der .env auf der VM")
|
||||
logger.info("Modus: %s %s", self.current_mode.config.emoji, self.current_mode.config.name)
|
||||
|
||||
# ── aria-core Verbindung (OpenClaw Gateway Protokoll) ───
|
||||
|
||||
Reference in New Issue
Block a user