system agents: generalise the scheduler and add the two memory lints
Nightly Build / build (push) Successful in 7m14s
Nightly Build / build (push) Successful in 7m14s
Memory is kept as a maintained wiki, and a wiki nobody prunes rots. This adds
the scheduled maintenance pass, and generalises the machinery TIC had grown so
that a background agent is a trait impl rather than a loop of its own.
Two lint agents, not one. The private pass runs per user over `user-memory/`
and reports to them; the shared pass runs once over `shared-memory/`, where the
interesting defect is different — a note failing the table rule, i.e. private
business written where every member can read it. It names the note and the
category without repeating the content, since restating it spreads the very
thing being flagged. Both share `agents/common/memory-lint.md`.
Both are read-only, and that is enforced twice: the prompt says report-never-
repair, and `shared-memory/*` writes are already `@fs_write require`, so an
agent that tried to fix something would raise an approval card from an
unattended pass, which is auto-denied. Read-only is the only design that works
here, not merely the safe one.
One scheduler for cadences three orders of magnitude apart. TIC runs every few
minutes, a lint weekly — the case that tempts a second loop. It stays one
because the wake-up decides nothing: `base_tick` picks only how often to look,
and whether an agent runs for a user is `is_due` against persisted state.
Due-ness moves out of the run log into a new owner table, `system_agent_state`.
The two answer different questions: the run log skips idle ticks so it stays a
history rather than a heartbeat, while scheduling needs every attempt. Reading
due-ness off the log would re-run an idle agent on every tick and never bring a
weekly one due once its last productive run aged out. Persisting it is also
what makes a long interval survive a restart — an in-memory deadline is fine at
TIC's scale, but a weekly agent on a box rebooted every few days would have it
re-armed before it ever fired.
The shared store belongs to nobody, so `AgentScope::Instance` runs that pass as
the first unlocked admin. An ownerless run would write its trace into system.db,
which the runs endpoint shows to nobody by design, and its notify() would have
no recipient; attributing it to a user keeps the whole per-user surface working
unchanged.
Settings move to where the run log is. `ConfigSet` gains `owner`, so placement
is data on the set rather than a page that knows set names; the System agents
page grows one tab per agent holding its description, its settings (admin only)
and its runs — "why did this do nothing last night?" is half a schedule
question and half a log question. The form is shared with the Config page, and
writes still go through PUT /api/config/{key}.
Fixes an authorization gap found on the way: neither /api/config handler took
the caller into account, so any authenticated session could read and write
instance-wide config. The sidebar hiding the page is presentation, not access
control. Both are now admin-gated.
This commit is contained in:
+27
-6
@@ -179,8 +179,6 @@ export default {
|
||||
|
||||
'config.set.interface.name': 'Interface',
|
||||
'config.set.interface.desc': 'Look and feel of the web interface.',
|
||||
'config.set.tic_agent.name': 'TIC Agent',
|
||||
'config.set.tic_agent.desc': 'TIC is a background agent that runs for every user, one at a time. For each user it reads the events their own connectors have pushed since the last run (new mail, calendar changes, incoming messages), decides — via an LLM call — which of them are worth surfacing, and sends those to that user as notifications. It reads only that user\'s events and writes only to their own conversation; a user who has not logged in since the last restart is skipped, because their database is still encrypted. Each run is recorded on the System agents page, visible to the user it ran for.',
|
||||
'config.set.compaction.name': 'Compaction',
|
||||
'config.set.compaction.desc': 'When a conversation grows too large, older messages are summarised by an LLM to keep the context within limits.',
|
||||
|
||||
@@ -188,10 +186,23 @@ export default {
|
||||
'config.prop.ui_locale.desc': 'Default interface language for the whole instance. Each user can override it on their profile.',
|
||||
'config.prop.tic__enabled.name': 'Enabled',
|
||||
'config.prop.tic__enabled.desc': 'Enable or disable the TIC agent for the whole instance. When disabled, no events are processed for anyone.',
|
||||
'config.prop.tic__security_group.name': 'Security Group',
|
||||
'config.prop.tic__security_group.name': 'Security group',
|
||||
'config.prop.tic__security_group.desc': 'Tool permission group applied to each TIC run. It is re-checked against each user\'s own role: a user whose role does not allow this group runs under their role\'s default group instead. Leave empty to always use the role default.',
|
||||
'config.prop.tic__interval_minutes.name': 'Check Interval (minutes)',
|
||||
'config.prop.tic__interval_minutes.desc': 'How often TIC starts a pass over all users, in minutes. Leave empty to use the value from config.yml (tic.interval_secs).',
|
||||
'config.prop.tic__interval_minutes.name': 'Check interval (minutes)',
|
||||
'config.prop.tic__interval_minutes.desc': 'How long between passes for each user, in minutes. Counted per person from their own last pass. Leave empty to use the value from config.yml (tic.interval_secs).',
|
||||
|
||||
'config.prop.memory_lint_private__enabled.name': 'Enabled',
|
||||
'config.prop.memory_lint_private__enabled.desc': 'Enable the private memory lint for the whole instance. When disabled, nobody\'s private store is checked.',
|
||||
'config.prop.memory_lint_private__security_group.name': 'Security group',
|
||||
'config.prop.memory_lint_private__security_group.desc': 'Tool permission group applied to each run. It is re-checked against each user\'s own role: a user whose role does not allow this group runs under their role\'s default group instead. Leave empty to always use the role default.',
|
||||
'config.prop.memory_lint_private__interval_days.name': 'Interval (days)',
|
||||
'config.prop.memory_lint_private__interval_days.desc': 'How long between passes for each user. Counted per person from their own last pass, and it survives a restart, so a long interval is not reset by rebooting the machine.',
|
||||
'config.prop.memory_lint_shared__enabled.name': 'Enabled',
|
||||
'config.prop.memory_lint_shared__enabled.desc': 'Enable the shared memory lint for the whole instance.',
|
||||
'config.prop.memory_lint_shared__security_group.name': 'Security group',
|
||||
'config.prop.memory_lint_shared__security_group.desc': 'Tool permission group applied to each run, re-checked against the admin\'s role. Leave empty to use the role default.',
|
||||
'config.prop.memory_lint_shared__interval_days.name': 'Interval (days)',
|
||||
'config.prop.memory_lint_shared__interval_days.desc': 'How long between passes over the shared store. It survives a restart, so a long interval is not reset by rebooting the machine.',
|
||||
'config.prop.compaction_model.name': 'Compaction model',
|
||||
'config.prop.compaction_model.desc': 'Model used to summarise compacted conversations, for the whole instance. A cheap model is usually enough. Leave empty for automatic selection.',
|
||||
|
||||
@@ -934,7 +945,7 @@ export default {
|
||||
|
||||
// ── System agents ───────────────────────────────────────────────────────────
|
||||
'system_agents.title': 'System agents',
|
||||
'system_agents.subtitle': 'Background agents the assistant runs for you on a schedule. They read the events your connectors receive and notify you when something looks worth your attention.',
|
||||
'system_agents.subtitle': 'Background agents that run on a schedule, without being asked. Each one works on your own data and notifies you directly; the runs below are yours and nobody else sees them.',
|
||||
'system_agents.loading': 'Loading…',
|
||||
'system_agents.empty': 'No runs yet.',
|
||||
'system_agents.empty_hint': 'A run is recorded only when there are new events to look at.',
|
||||
@@ -954,8 +965,18 @@ export default {
|
||||
|
||||
'system_agents.stat.events_processed': 'events',
|
||||
'system_agents.stat.notifications_emitted': 'notifications',
|
||||
'system_agents.stat.notes_examined': 'notes read',
|
||||
|
||||
'system_agents.pagination': 'Page {cur} of {pages} — {total} runs',
|
||||
'system_agents.tab.all': 'All',
|
||||
'system_agents.settings': 'Settings',
|
||||
|
||||
'system_agents.agent.tic.name': 'TIC',
|
||||
'system_agents.agent.tic.desc': 'Reads the events your connectors receive — new mail, calendar changes, incoming messages — decides which of them are worth your attention, and notifies you about those. It runs for one person at a time and reads only that person\'s events.',
|
||||
'system_agents.agent.memory-lint-private.name': 'Private memory lint',
|
||||
'system_agents.agent.memory-lint-private.desc': 'A periodic check-up of your own memory. It looks for facts whose date has gone by, questions you were asked and never answered, notes the index has lost track of, and duplicates worth merging — then tells you what it found. It never edits your notes.',
|
||||
'system_agents.agent.memory-lint-shared.name': 'Shared memory lint',
|
||||
'system_agents.agent.memory-lint-shared.desc': 'The same check-up over the group\'s shared memory, plus the problem that only exists there: something private written where every member can read it. The shared store belongs to nobody, so this runs as the admin and reports to them. It never edits anything.',
|
||||
|
||||
// ── File viewer ─────────────────────────────────────────────────────────────
|
||||
'fv.back': 'Back',
|
||||
|
||||
+25
-4
@@ -179,8 +179,6 @@ export default {
|
||||
|
||||
'config.set.interface.name': 'Interface',
|
||||
'config.set.interface.desc': 'Aspect et style de l\'interface web.',
|
||||
'config.set.tic_agent.name': 'Agent TIC',
|
||||
'config.set.tic_agent.desc': 'TIC est un agent d\'arrière-plan exécuté pour chaque utilisateur, un à la fois. Pour chacun, il lit les événements reçus par ses propres connecteurs depuis la dernière exécution (nouveaux e-mails, changements d\'agenda, messages entrants), décide — via un appel LLM — lesquels méritent d\'être signalés, et les lui envoie sous forme de notifications. Il ne lit que les événements de cet utilisateur et n\'écrit que dans sa propre conversation ; un utilisateur qui ne s\'est pas connecté depuis le dernier redémarrage est ignoré, car sa base de données est encore chiffrée. Chaque exécution est enregistrée sur la page Agents système, visible par l\'utilisateur concerné.',
|
||||
'config.set.compaction.name': 'Compaction',
|
||||
'config.set.compaction.desc': 'Lorsqu\'une conversation devient trop longue, les messages les plus anciens sont résumés par un LLM pour garder le contexte dans les limites.',
|
||||
|
||||
@@ -191,7 +189,20 @@ export default {
|
||||
'config.prop.tic__security_group.name': 'Groupe de sécurité',
|
||||
'config.prop.tic__security_group.desc': 'Groupe de permissions d\'outils appliqué à chaque exécution de TIC. Il est revérifié selon le rôle de chaque utilisateur : si son rôle n\'autorise pas ce groupe, l\'exécution utilise le groupe par défaut de son rôle. Laissez vide pour toujours utiliser celui du rôle.',
|
||||
'config.prop.tic__interval_minutes.name': 'Intervalle de vérification (minutes)',
|
||||
'config.prop.tic__interval_minutes.desc': 'Fréquence à laquelle TIC lance un passage sur tous les utilisateurs, en minutes. Laissez vide pour utiliser la valeur de config.yml (tic.interval_secs).',
|
||||
'config.prop.tic__interval_minutes.desc': 'Temps écoulé entre deux passages pour chaque utilisateur, en minutes. Compté par personne depuis son propre dernier passage. Laissez vide pour utiliser la valeur de config.yml (tic.interval_secs).',
|
||||
|
||||
'config.prop.memory_lint_private__enabled.name': 'Activé',
|
||||
'config.prop.memory_lint_private__enabled.desc': 'Activer l\'entretien de la mémoire privée pour toute l\'instance. Lorsqu\'il est désactivé, la mémoire privée de personne n\'est vérifiée.',
|
||||
'config.prop.memory_lint_private__security_group.name': 'Groupe de sécurité',
|
||||
'config.prop.memory_lint_private__security_group.desc': 'Groupe de permissions d\'outils appliqué à chaque exécution. Il est revérifié selon le rôle de chaque utilisateur : si son rôle n\'autorise pas ce groupe, l\'exécution utilise le groupe par défaut de son rôle. Laissez vide pour toujours utiliser celui du rôle.',
|
||||
'config.prop.memory_lint_private__interval_days.name': 'Intervalle (jours)',
|
||||
'config.prop.memory_lint_private__interval_days.desc': 'Temps écoulé entre deux passages pour chaque utilisateur. Compté par personne depuis son propre dernier passage, et conservé au redémarrage : redémarrer la machine ne réinitialise pas un intervalle long.',
|
||||
'config.prop.memory_lint_shared__enabled.name': 'Activé',
|
||||
'config.prop.memory_lint_shared__enabled.desc': 'Activer l\'entretien de la mémoire partagée pour toute l\'instance.',
|
||||
'config.prop.memory_lint_shared__security_group.name': 'Groupe de sécurité',
|
||||
'config.prop.memory_lint_shared__security_group.desc': 'Groupe de permissions d\'outils appliqué à chaque exécution, revérifié selon le rôle de l\'administrateur. Laissez vide pour utiliser celui du rôle.',
|
||||
'config.prop.memory_lint_shared__interval_days.name': 'Intervalle (jours)',
|
||||
'config.prop.memory_lint_shared__interval_days.desc': 'Temps écoulé entre deux passages sur la mémoire partagée. Conservé au redémarrage : redémarrer la machine ne réinitialise pas un intervalle long.',
|
||||
'config.prop.compaction_model.name': 'Modèle de compaction',
|
||||
'config.prop.compaction_model.desc': 'Modèle utilisé pour résumer les conversations compactées, pour toute l\'instance. Un modèle économique suffit généralement. Laissez vide pour une sélection automatique.',
|
||||
|
||||
@@ -924,7 +935,7 @@ export default {
|
||||
|
||||
// ── Agents système ──────────────────────────────────────────────────────────
|
||||
'system_agents.title': 'Agents système',
|
||||
'system_agents.subtitle': 'Agents en arrière-plan que l\'assistant exécute pour vous à intervalles réguliers. Ils lisent les événements reçus par vos connecteurs et vous préviennent lorsque quelque chose mérite votre attention.',
|
||||
'system_agents.subtitle': 'Agents en arrière-plan exécutés à intervalles réguliers, sans que vous ayez à le demander. Chacun travaille sur vos propres données et vous prévient directement ; les exécutions ci-dessous sont les vôtres et personne d\'autre ne les voit.',
|
||||
'system_agents.loading': 'Chargement…',
|
||||
'system_agents.empty': 'Aucune exécution.',
|
||||
'system_agents.empty_hint': 'Une exécution n\'est enregistrée que lorsqu\'il y a de nouveaux événements à examiner.',
|
||||
@@ -944,8 +955,18 @@ export default {
|
||||
|
||||
'system_agents.stat.events_processed': 'événements',
|
||||
'system_agents.stat.notifications_emitted': 'notifications',
|
||||
'system_agents.stat.notes_examined': 'notes lues',
|
||||
|
||||
'system_agents.pagination': 'Page {cur} sur {pages} — {total} exécutions',
|
||||
'system_agents.tab.all': 'Tous',
|
||||
'system_agents.settings': 'Paramètres',
|
||||
|
||||
'system_agents.agent.tic.name': 'TIC',
|
||||
'system_agents.agent.tic.desc': 'Lit les événements reçus par vos connecteurs — nouveaux e-mails, changements d\'agenda, messages entrants — décide lesquels méritent votre attention et ne vous signale que ceux-là. Il s\'exécute pour une personne à la fois et ne lit que les événements de cette personne.',
|
||||
'system_agents.agent.memory-lint-private.name': 'Entretien de la mémoire privée',
|
||||
'system_agents.agent.memory-lint-private.desc': 'Une vérification périodique de votre mémoire. Elle recherche les faits dont la date est passée, les questions qui vous ont été posées et restées sans réponse, les notes que l\'index a perdues de vue et les doublons à fusionner — puis vous dit ce qu\'elle a trouvé. Elle ne modifie jamais vos notes.',
|
||||
'system_agents.agent.memory-lint-shared.name': 'Entretien de la mémoire partagée',
|
||||
'system_agents.agent.memory-lint-shared.desc': 'La même vérification sur la mémoire partagée du groupe, plus le problème qui n\'existe que là : quelque chose de privé écrit là où tous les membres peuvent le lire. La mémoire partagée n\'appartient à personne, cet agent s\'exécute donc en tant qu\'administrateur et lui adresse son rapport. Il ne modifie jamais rien.',
|
||||
|
||||
// ── File viewer ─────────────────────────────────────────────────────────────
|
||||
'fv.back': 'Retour',
|
||||
|
||||
+25
-4
@@ -203,8 +203,6 @@ export default {
|
||||
|
||||
'config.set.interface.name': 'Interfaccia',
|
||||
'config.set.interface.desc': 'Aspetto e stile dell\'interfaccia web.',
|
||||
'config.set.tic_agent.name': 'Agente TIC',
|
||||
'config.set.tic_agent.desc': 'TIC è un agente in background che viene eseguito per ogni utente, uno alla volta. Per ciascun utente legge gli eventi che i suoi connettori hanno ricevuto dall\'ultima esecuzione (nuove email, modifiche al calendario, messaggi in arrivo), decide — tramite una chiamata LLM — quali meritano attenzione e glieli inoltra come notifiche. Legge solo gli eventi di quell\'utente e scrive solo nella sua conversazione; un utente che non ha effettuato l\'accesso dall\'ultimo riavvio viene saltato, perché il suo database è ancora cifrato. Ogni esecuzione viene registrata nella pagina Agenti di sistema, visibile all\'utente per cui è stata eseguita.',
|
||||
'config.set.compaction.name': 'Compattazione',
|
||||
'config.set.compaction.desc': 'Quando una conversazione diventa troppo lunga, i messaggi più vecchi vengono riassunti da un LLM per mantenere il contesto entro i limiti.',
|
||||
|
||||
@@ -215,7 +213,20 @@ export default {
|
||||
'config.prop.tic__security_group.name': 'Gruppo di sicurezza',
|
||||
'config.prop.tic__security_group.desc': 'Gruppo di permessi strumenti applicato a ogni esecuzione di TIC. Viene riverificato sul ruolo di ciascun utente: se il ruolo non consente questo gruppo, l\'esecuzione usa il gruppo predefinito del ruolo. Lascia vuoto per usare sempre il predefinito del ruolo.',
|
||||
'config.prop.tic__interval_minutes.name': 'Intervallo di controllo (minuti)',
|
||||
'config.prop.tic__interval_minutes.desc': 'Ogni quanto TIC avvia un giro su tutti gli utenti, in minuti. Lascia vuoto per usare il valore da config.yml (tic.interval_secs).',
|
||||
'config.prop.tic__interval_minutes.desc': 'Quanto tempo passa tra un giro e l\'altro per ciascun utente, in minuti. Conteggiato per persona a partire dal suo ultimo giro. Lascia vuoto per usare il valore da config.yml (tic.interval_secs).',
|
||||
|
||||
'config.prop.memory_lint_private__enabled.name': 'Attivo',
|
||||
'config.prop.memory_lint_private__enabled.desc': 'Attiva la manutenzione della memoria privata per l\'intera istanza. Quando è disattivata, la memoria privata di nessuno viene controllata.',
|
||||
'config.prop.memory_lint_private__security_group.name': 'Gruppo di sicurezza',
|
||||
'config.prop.memory_lint_private__security_group.desc': 'Gruppo di permessi strumenti applicato a ogni esecuzione. Viene riverificato sul ruolo di ciascun utente: se il ruolo non consente questo gruppo, l\'esecuzione usa il gruppo predefinito del ruolo. Lascia vuoto per usare sempre il predefinito del ruolo.',
|
||||
'config.prop.memory_lint_private__interval_days.name': 'Intervallo (giorni)',
|
||||
'config.prop.memory_lint_private__interval_days.desc': 'Quanto tempo passa tra un giro e l\'altro per ciascun utente. Conteggiato per persona dal suo ultimo giro, e sopravvive al riavvio: riavviare la macchina non azzera un intervallo lungo.',
|
||||
'config.prop.memory_lint_shared__enabled.name': 'Attivo',
|
||||
'config.prop.memory_lint_shared__enabled.desc': 'Attiva la manutenzione della memoria condivisa per l\'intera istanza.',
|
||||
'config.prop.memory_lint_shared__security_group.name': 'Gruppo di sicurezza',
|
||||
'config.prop.memory_lint_shared__security_group.desc': 'Gruppo di permessi strumenti applicato a ogni esecuzione, riverificato sul ruolo dell\'amministratore. Lascia vuoto per usare il predefinito del ruolo.',
|
||||
'config.prop.memory_lint_shared__interval_days.name': 'Intervallo (giorni)',
|
||||
'config.prop.memory_lint_shared__interval_days.desc': 'Quanto tempo passa tra un giro e l\'altro sulla memoria condivisa. Sopravvive al riavvio: riavviare la macchina non azzera un intervallo lungo.',
|
||||
'config.prop.compaction_model.name': 'Modello per la compattazione',
|
||||
'config.prop.compaction_model.desc': 'Modello usato per riassumere le conversazioni compattate, per tutta l\'istanza. Un modello economico di solito è sufficiente. Lascia vuoto per la selezione automatica.',
|
||||
|
||||
@@ -924,7 +935,7 @@ export default {
|
||||
|
||||
// ── Agenti di sistema ───────────────────────────────────────────────────────
|
||||
'system_agents.title': 'Agenti di sistema',
|
||||
'system_agents.subtitle': 'Agenti in background che l\'assistente esegue per te a intervalli regolari. Leggono gli eventi che arrivano dai tuoi connettori e ti avvisano quando c\'è qualcosa che merita attenzione.',
|
||||
'system_agents.subtitle': 'Agenti in background che vengono eseguiti a intervalli regolari, senza che tu debba chiedere nulla. Ognuno lavora sui tuoi dati e avvisa te direttamente; le esecuzioni qui sotto sono le tue e nessun altro le vede.',
|
||||
'system_agents.loading': 'Caricamento…',
|
||||
'system_agents.empty': 'Nessuna esecuzione.',
|
||||
'system_agents.empty_hint': 'Un\'esecuzione viene registrata solo quando ci sono nuovi eventi da esaminare.',
|
||||
@@ -944,8 +955,18 @@ export default {
|
||||
|
||||
'system_agents.stat.events_processed': 'eventi',
|
||||
'system_agents.stat.notifications_emitted': 'notifiche',
|
||||
'system_agents.stat.notes_examined': 'note lette',
|
||||
|
||||
'system_agents.pagination': 'Pagina {cur} di {pages} — {total} esecuzioni',
|
||||
'system_agents.tab.all': 'Tutti',
|
||||
'system_agents.settings': 'Impostazioni',
|
||||
|
||||
'system_agents.agent.tic.name': 'TIC',
|
||||
'system_agents.agent.tic.desc': 'Legge gli eventi che arrivano dai tuoi connettori — nuove email, modifiche al calendario, messaggi in arrivo — decide quali meritano la tua attenzione e ti avvisa solo di quelli. Viene eseguito per una persona alla volta e legge solo gli eventi di quella persona.',
|
||||
'system_agents.agent.memory-lint-private.name': 'Manutenzione memoria privata',
|
||||
'system_agents.agent.memory-lint-private.desc': 'Un controllo periodico della tua memoria. Cerca fatti la cui data è ormai passata, domande che ti sono state poste e a cui non hai mai risposto, note di cui l\'indice ha perso traccia e duplicati da unire — poi ti dice cosa ha trovato. Non modifica mai le tue note.',
|
||||
'system_agents.agent.memory-lint-shared.name': 'Manutenzione memoria condivisa',
|
||||
'system_agents.agent.memory-lint-shared.desc': 'Lo stesso controllo sulla memoria condivisa del gruppo, più il problema che esiste solo lì: qualcosa di privato scritto dove tutti i membri possono leggerlo. La memoria condivisa non appartiene a nessuno, quindi questo agente viene eseguito come amministratore e segnala a lui. Non modifica mai nulla.',
|
||||
|
||||
// ── File viewer ──────────────────────────────────────────────────────────────
|
||||
'fv.back': 'Indietro',
|
||||
|
||||
Reference in New Issue
Block a user