← Back to PRs

#14690: feat(agent-autonomy): add runtime behavioral health monitor

by career091101 open 2026-02-12 14:00 View on GitHub →
stale size: L
## Summary - Add a VIGIL-inspired runtime behavioral health monitor for agent sessions - Detects degradation patterns in real-time: failure streaks, execution loops, rising error rates, context budget exhaustion, and stalled progress - Each signal produces severity score, suggested intervention, and affected tool list; overall assessment computes a 0–100 health score (healthy/degraded/critical) ## Changes - `extensions/agent-autonomy/src/behavioral-health-monitor.ts` — monitor implementation (493 lines) - `extensions/agent-autonomy/src/behavioral-health-monitor.test.ts` — comprehensive test suite (429 lines) ## Test plan - [x] Unit tests included covering all 5 signal types - [ ] CI pass on this branch Ref: [VIGIL paper](https://arxiv.org/abs/2512.07094) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR adds a new `BehavioralHealthMonitor` to the `agent-autonomy` extension that records tool-call events and computes a health assessment based on five degradation signals (failure streak, execution loop, rising error rate, context exhaustion, stalled progress). It also introduces a comprehensive Vitest suite that exercises each signal and the combined scoring/action derivation. The monitor is currently self-contained within `extensions/agent-autonomy/src/` and is intended to be consumed by agent session/runtime logic to detect real-time degradation and suggest interventions. <h3>Confidence Score: 2/5</h3> - Not safe to merge as-is due to a build-breaking missing import/module. - The new monitor file imports `./types.js`, but that module does not exist in this extension in the provided changeset/HEAD tree, which should break TypeScript resolution and CI. There is also an API/doc mismatch in `getEventCount()` semantics that can mislead consumers. - extensions/agent-autonomy/src/behavioral-health-monitor.ts <!-- greptile_other_comments_section --> <sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub> <!-- /greptile_comment -->

Most Similar PRs