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

lsm / neokai / 25638804169
82%

Build:
DEFAULT BRANCH: dev
Ran 10 May 2026 08:21PM UTC
Jobs 28
Files 522
Run time 2min
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: 82.459% (+0.02%) from 82.442%
25638804169

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)

8309 of 11589 branches covered (71.7%)

Branch coverage included in aggregate %.

112 of 116 new or added lines in 2 files covered. (96.55%)

65178 of 77530 relevant lines covered (84.07%)

290.1 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
95.88
packages/daemon/src/lib/agent/loop-detector-hook.ts
Jobs
ID Job ID Ran Files Coverage
1 daemon-5-space-other - 25638804169.1 10 May 2026 08:21PM UTC 126
31.12
GitHub Action Run
2 daemon-4-space-storage - 25638804169.2 10 May 2026 08:22PM UTC 132
55.68
GitHub Action Run
3 daemon-online-coordinator - 25638804169.3 10 May 2026 08:21PM UTC 287
7.43
GitHub Action Run
4 daemon-0-shared - 25638804169.4 10 May 2026 08:21PM UTC 29
84.15
GitHub Action Run
5 daemon-online-space-1 - 25638804169.5 10 May 2026 08:22PM UTC 287
32.32
GitHub Action Run
6 daemon-1-core - 25638804169.6 10 May 2026 08:21PM UTC 292
37.91
GitHub Action Run
7 daemon-online-rpc-3 - 25638804169.7 10 May 2026 08:22PM UTC 287
20.04
GitHub Action Run
8 daemon-online-rpc-4 - 25638804169.8 10 May 2026 08:23PM UTC 287
23.66
GitHub Action Run
9 daemon-5-space-workflow - 25638804169.9 10 May 2026 08:21PM UTC 107
31.41
GitHub Action Run
10 daemon-5-space-agent - 25638804169.10 10 May 2026 08:21PM UTC 170
28.2
GitHub Action Run
11 daemon-online-git - 25638804169.11 10 May 2026 08:21PM UTC 287
18.94
GitHub Action Run
12 daemon-online-rpc-1 - 25638804169.12 10 May 2026 08:22PM UTC 287
19.3
GitHub Action Run
13 daemon-online-features-1 - 25638804169.13 10 May 2026 08:22PM UTC 287
23.13
GitHub Action Run
14 daemon-2-handlers - 25638804169.14 10 May 2026 08:21PM UTC 129
56.97
GitHub Action Run
15 daemon-online-rpc-2 - 25638804169.15 10 May 2026 08:22PM UTC 287
23.75
GitHub Action Run
16 daemon-online-agent-sdk - 25638804169.16 10 May 2026 08:22PM UTC 287
22.37
GitHub Action Run
17 daemon-online-sdk - 25638804169.17 10 May 2026 08:21PM UTC 287
22.26
GitHub Action Run
18 daemon-5-space-runtime - 25638804169.18 10 May 2026 08:21PM UTC 148
40.18
GitHub Action Run
19 daemon-online-websocket - 25638804169.19 10 May 2026 08:21PM UTC 287
17.93
GitHub Action Run
20 daemon-online-rewind-2 - 25638804169.20 10 May 2026 08:22PM UTC 287
23.11
GitHub Action Run
21 daemon-online-components - 25638804169.21 10 May 2026 08:21PM UTC 287
17.8
GitHub Action Run
22 daemon-online-rewind-1 - 25638804169.22 10 May 2026 08:22PM UTC 287
22.56
GitHub Action Run
23 daemon-online-space-2 - 25638804169.23 10 May 2026 08:23PM UTC 287
32.18
GitHub Action Run
24 daemon-online-features-2 - 25638804169.24 10 May 2026 08:22PM UTC 287
22.78
GitHub Action Run
25 web - 25638804169.25 10 May 2026 08:22PM UTC 222
76.58
GitHub Action Run
26 daemon-online-lifecycle - 25638804169.26 10 May 2026 08:22PM UTC 287
22.81
GitHub Action Run
27 daemon-online-mcp - 25638804169.27 10 May 2026 08:21PM UTC 287
18.25
GitHub Action Run
28 daemon-online-convo - 25638804169.28 10 May 2026 08:22PM UTC 287
22.25
GitHub Action Run
Source Files on build 25638804169
  • Tree
  • List 522
  • Changed 5
  • Source Changed 1
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #25638804169
  • 2898120f on github
  • Prev Build on dev (#25635713532)
  • Next Build on dev (#25641967925)
  • 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