Commit Graph

15 Commits

Author SHA1 Message Date
sylvain 88c963a28c feat: implement /update in BaseAgent (git pull + systemctl restart)
- _do_self_update(): git pull, skip restart if already up to date,
  send result back via MQTT reply_to before restarting (2s delay)
- _get_install_dir(): derive from config path
- _get_service_name(): from config or install dir basename

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 19:19:11 +00:00
sylvain f714e8ae8a feat: OMEMO E2E encryption for all agents (XMPP direct messages)
- Add omemo_storage.py: SQLite key/value backend for python-omemo
- Rewrite xmpp_client.py OMEMO support: real XEP_0384 plugin subclass
  with BTBV (Blind Trust Before Verification / TOFU for bots)
- Async decrypt in _on_message handler, async encrypt in _send_omemo
- MUC messages remain plaintext (OMEMO MUC not widely supported)
- base_agent.py: pass data_dir to XMPPClient for OMEMO storage
- setup.py: bump omemo extra to slixmpp-omemo>=2.0

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 19:06:47 +00:00
sylvain f71cd0d48d feat(mqtt): add unsubscribe() method to MQTTClient
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 14:30:30 +00:00
sylvain 0dd871950f fix: stoppe l'event loop asyncio sur disconnected/connection_failed pour débloquer la reconnexion automatique 2026-03-12 14:21:58 +00:00
sylvain 0b5ed2fd1f fix: empêche les appels LLM concurrents via _llm_lock
Si le LLM est déjà occupé, répond immédiatement au lieu d'empiler
les requêtes. Évite la queue silencieuse qui bloquait les agents
pendant plusieurs minutes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09 18:02:18 +00:00
sylvain 75687957fb fix: 3 correctifs stabilité agents
- base_agent: sub-agents ignorent les messages MUC (évite boucles)
- base_agent: reset historique LLM lors d'un switch de modèle
- base_agent: _save_config utilise _config_path (déjà fait)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09 17:54:56 +00:00
sylvain fef2304421 docs: ajout README.md 2026-03-09 17:47:50 +00:00
sylvain af1d14e202 feat: LLM switch via MQTT — profils local/cloud synchronisés
- Stocke _config_path dans BaseAgent pour la persistance
- Souscription à agents/llm/switch (retained) sur tous les agents
- _on_llm_switch : change self.llm.model + persiste dans config.json
- _save_config : écrit la config en mémoire dans le fichier JSON

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09 17:35:13 +00:00
sylvain 8a6432e5f8 fix: dispatch XMPP message callback in thread to avoid blocking asyncio loop
The LLM call (up to 300s) was blocking the slixmpp asyncio event loop,
preventing keepalive pings and causing the server to close the connection.
All XMPP message handling now runs in a daemon thread.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09 16:44:59 +00:00
sylvain 654e238d7e Increase LLM timeout from 120s to 300s
qwen3:8b can take over 120s on complex tasks causing silent failures
and queue buildup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09 16:27:15 +00:00
sylvain 813c77651c Add XMPP auto-reconnect loop
XMPPClient.connect_async() now runs a persistent reconnect loop in a
daemon thread. On connection loss, it reconnects after 5s with
exponential backoff up to 60s. The on_ready callback is only called
on the first successful connection.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09 14:36:31 +00:00
sylvain a6c3bfc3d6 Add build/ to .gitignore
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09 13:05:44 +00:00
sylvain d390d8a07a Fix real-time agent status tracking and add status hooks
- Fix root cause: Message.from_json was parsing status/capabilities
  payloads (plain JSON dicts) as Message objects with empty payload,
  causing _on_status_update to silently fail. Now plain JSON payloads
  (no 'type'/'sender' keys) are passed as raw strings to callbacks.
- _on_status_update: ignore own status, call on_agent_status_change
  hook only when status actually changes (was_online != is_online)
- Add on_agent_status_change(agent_id, status) hook in BaseAgent
- Add on_xmpp_connected() hook in BaseAgent
- XMPPClient.connect_async() accepts on_ready callback

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09 13:03:30 +00:00
sylvain 7ab395037d Fix slixmpp 1.13 compatibility and empty capabilities handling
- Replace process(forever=True) with asyncio event loop in _SlixClient.start()
- Make send_xmpp_message() thread-safe via loop.call_soon_threadsafe()
- Remove wait=True from join_muc() (no longer supported in slixmpp 1.13)
- Silence empty retained MQTT capability messages in CapabilitiesRegistry

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09 10:28:28 +00:00
sylvain c1666db5aa Initial commit — agents_core v2.0 2026-03-09 09:01:32 +00:00