Passa al contenuto principale

AgentCore Telegram Live Test

Questo runbook chiude TASK-239 lato operativo dopo il deploy di AgentCore. Il live test resta bloccato finche' il framework AgentCore non carica i plugin da /etc/agentcore/*.yml e l'immagine ghcr.io/mbagnoli-bit/agent-core:latest non e' pubblicata.

Prerequisiti

  • TASK-243 completato: immagine ghcr.io/mbagnoli-bit/agent-core:latest disponibile.
  • Follow-up AgentCore plugin loader completato: bootstrap da AGENTCORE_AKIRA_PLUGIN_CONFIG=/etc/agentcore/akira-plugin.yml.
  • manage_agentcore: true su management dopo la pubblicazione immagine.
  • AGENTCORE_TELEGRAM_ALLOWED_USER_IDS contiene Telegram user.id numerici autorizzati.
  • Backend Akira raggiungibile dal container AgentCore su /mcp.

Pre-flight

ssh root@akira-mgmt-01-staging '
cd /opt/akira
docker compose ps agent-core backend
docker exec akira-agent-core env | grep -E "AGENTCORE_AKIRA_MCP_URL|AGENTCORE_AKIRA_PLUGIN_CONFIG|AGENTCORE_TELEGRAM_ALLOWED_USER_IDS"
docker exec akira-agent-core test -f /etc/agentcore/akira-plugin.yml
curl -fsS http://127.0.0.1:8000/mcp | jq ".tools[].name"
'

Non stampare token Telegram, Anthropic o MCP nei log.

Test Telegram

Da un account Telegram whitelisted, inviare a @AkiraOpsBot:

/start
/balance company:Acme-SRL
/cdr last 10
/balance set company:Acme-SRL amount:1000
/ticket "test smoke 239" severity:medium
/company create name:TestCorp
quante chiamate ha fatto Acme SRL nelle ultime 24h?
qual e' il margine di Acme SRL questo mese?
mostrami i ticket aperti con severity alta
/balance company:NonEsiste-SRL
/ticket
/spaccacode rm -rf /

Risultati attesi:

  • /start risponde con welcome message.
  • I 5 comandi base invocano i tool dichiarati in akira-plugin.yml.
  • Le risposte dei comandi base arrivano in meno di 5 secondi.
  • Almeno 2 query NL su 3 inferiscono il tool corretto e rispondono in italiano.
  • Gli errori sono user-friendly, senza stacktrace e senza silent ignore.
  • Un utente non whitelisted riceve "Non autorizzato".

Audit

ssh root@akira-mgmt-01-staging '
docker exec akira-backend python - <<'"'"'PY'"'"'
import asyncio
from sqlalchemy import text
from akira_backend.core.db import AsyncSessionLocal

async def main():
async with AsyncSessionLocal() as session:
rows = await session.execute(text("""
SELECT ts, actor, entity_type, entity_id
FROM audit_log
WHERE actor LIKE 'agentcore:%'
ORDER BY ts DESC
LIMIT 10
"""))
for row in rows:
print(f"{row.ts} | {row.actor} | {row.entity_type}#{row.entity_id}")

asyncio.run(main())
PY
'

Ogni comando eseguito via Telegram deve produrre audit actor nel formato agentcore:<telegram_user_id_numero>, per esempio agentcore:7101418424.

Report

Creare AGENTCORE-LIVE-{YYYY-MM-DD}.md con tabella di comandi, tool invocato, tempo risposta e outcome. Se una dipendenza runtime e' ancora assente, marcare il report BLOCKED e indicare esplicitamente la dipendenza mancante.