Commit graph

5 commits

Author SHA1 Message Date
rcourtman
82c615b3b9 Filter virtual disks from SMART checks to prevent false positives (#1329)
ZFS zvols (zd*), device-mapper, virtio disks, and other virtual block
devices don't support SMART and were being reported as FAILED. Use lsblk
JSON metadata to filter by device prefix, transport, subsystem, and
vendor/model. Also treat missing smart_status as unknown rather than
failed, and ignore UNKNOWN health in Patrol/AI signals.
2026-03-08 22:16:24 +00:00
rcourtman
81ec5c525a feat(ai): parallelize tool execution and refine knowledge extraction
- Implement parallel execution for read-only tools in agentic loop
- Optimize negative marker summaries to be more informative
- Fix memory percentage scaling in query tools
- Add derived memory stats (avg/max) to extraction logic
- Add explicit fresh data intent detection to bypass knowledge gate
- Update associated tests
2026-02-01 00:12:36 +00:00
rcourtman
50ecd62ae6 feat(ai): add extractors for all tool actions and fix predict/extract key mismatches
Major expansion of the knowledge extraction system with extractors for
every tool action, plus critical bug fixes discovered during live testing:

Extractors added:
- query: topology, health, search, list, config (with secondary cached key)
- storage: pools, disk_health, raid, backups, backup_tasks, ceph, ceph_details,
  snapshots, replication, pbs_jobs, resource_disks
- metrics: performance, baselines, physical disks, temperatures
- alerts: list, findings (with resource_id in key to prevent collisions)
- docker: services, updates, swarm, tasks
- kubernetes: clusters, nodes, pods, deployments
- pmg: status, mail_stats, queues, spam
- patrol: get_findings
- exec/read: file reads and command execution

Bug fixes from live testing:
- Config predict key mismatch: model omits node from input, added secondary
  config:{resource_id}:cached key for reliable gate matching
- Baselines predict key mismatch: predict returned baseline:{id} but extractor
  stores baselines:queried; simplified predict to always return marker key
- Query:get composite ID: resource.ID contained node prefix (delly:minipc:100),
  now prefers VMID (int) over composite string
- Alerts findings wrong JSON field: struct expected "findings" but API returns
  "active" with separate "counts" object
- Finding key collision: two findings with same key but different resource_id
  overwrote each other; added resource_id to fact key
- Backup tasks vmid type: API returns int but struct had string, causing
  json.Unmarshal failure; also fixed status case-sensitivity (OK vs ok)

Tests: 91+ tests including 38 roundtrip cases, 5 gate flow tests, negative
marker test. All pass.
2026-01-31 22:24:54 +00:00
rcourtman
82ddeac454 refactor(ai): refine agentic loop compaction and knowledge accumulation
- Inject wrap-up nudges/escalations after token/turn thresholds are met
- Update compaction logic to include key accumulated facts in summaries
- Refine knowledge extraction and accumulation tests
- Update main entry point for revised AI configuration
2026-01-31 19:33:43 +00:00
rcourtman
c5717d1a10 feat(ai): add knowledge accumulation and enhance agentic loop
- Introduce KnowledgeAccumulator to persist facts across turns
- Enhance AgenticLoop to support knowledge injection and final text summaries
- Update chat service to wire up knowledge components
- Frontend updates to support enhanced chat capabilities
2026-01-31 16:22:50 +00:00