• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lsm / neokai / 25638804169 / 28
82%
dev: 82%

Build:
DEFAULT BRANCH: dev
Ran 10 May 2026 08:23PM UTC
Files 287
Run time 7s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

10 May 2026 08:20PM UTC coverage: 22.247% (-0.006%) from 22.253%
25638804169.28

push

github

web-flow
feat(daemon): detect and recover from dead loops in agent execution (#1849)

* feat(daemon): detect and recover from dead loops in agent execution

Adds a PreToolUse hook that detects when the agent calls Read/Grep/Glob
repeatedly with identical arguments (the failure mode observed in task
#324) and short-circuits the duplicate call with a permissionDecision:
'deny' carrying a recovery message that the SDK delivers back to the
model as the tool result.

Thresholds: Read at 3 consecutive identical calls, Grep/Glob at 5,
within a 60s sliding window. Bash is not tracked because legitimate
output (git status, tail -f) genuinely changes between calls. Counters
reset after a deny so the agent can retry once it has performed a
different action.

Closes task #328.

* docs(daemon): clarify loop-detector docs and tighten threshold-merge test

Addresses review feedback on #1849:

- Updates the loop-detector docstrings, inline comments, recovery message,
  and warn log to say "accumulated within a short window" instead of
  "consecutive" / "in a row" — the implementation never required strict
  consecutiveness, only that the entry stays alive within the sliding
  window.
- Renames the "does not track tools with no configured threshold" test
  to "merges partial threshold overrides with defaults (Grep stays
  tracked at the default)" and adds an actual Grep assertion proving
  that overriding Read alone preserves the default Grep=5 threshold.
- Documents on createLoopDetectorHook and at the buildHooks() call site
  that production wires the hook with no arguments and the `config`
  parameter exists only for unit-test overrides.

* refactor(daemon): tighten loop-detector semantics per review

Address P2 feedback on the dead-loop detector:

1. Strict consecutive streak — track per-(scope) `lastKey`; any
   different tracked-tool call resets the count. Prevents the
   `Read(a) -> Read(b) -> Read(a) -> Read(a)` false positive.

2. REPLACE not merge for threshold overr... (continued)

16687 of 75009 relevant lines covered (22.25%)

11.62 hits per line

Source Files on job daemon-online-convo - 25638804169.28
  • Tree
  • List 287
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 25638804169
  • 2898120f on github
  • Prev Job for on dev (#25635713532.14)
  • Next Job for on dev (#25641967925.3)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc