zucchini
a3d8d8ab92
fix(observer): auto-scale max_turns by analysis batch size ( #2062 )
...
* fix(observer): auto-scale max_turns by analysis batch size (#2035 )
The hardcoded default of MAX_TURNS=20 is insufficient when
MAX_ANALYSIS_LINES=500 (also the default). Claude exhausts its turn
budget before it can write all discovered instinct files, producing:
Error: Reached max turns (20)
Fix: when ECC_OBSERVER_MAX_TURNS is not explicitly set, compute
max_turns proportionally to the actual analysis batch size:
max_turns = clamp(analysis_count / 10, 20, 100)
This gives:
- 20–199 lines → 20 turns (existing floor, unchanged)
- 500 lines → 50 turns (resolves the reported failure)
- 1000 lines → 100 turns (cap)
Explicitly setting ECC_OBSERVER_MAX_TURNS still overrides the
auto-scaled value, preserving the existing escape hatch.
* test(observer): update max_turns test for auto-scaling; document validation
The max-turns budget test in tests/hooks/hooks.test.js still asserted the removed literal max_turns="${ECC_OBSERVER_MAX_TURNS:-20}", which would fail against the new auto-scaling logic. Assert the auto-scale formula and the 20/100 clamp bounds instead.
Also add the explanatory comment CodeRabbit requested above the max_turns sanitization block, clarifying it guards the explicit ECC_OBSERVER_MAX_TURNS override path.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-07 13:25:29 +08:00
..
2026-04-30 00:21:13 -04:00
2026-05-11 22:16:11 -04:00
2026-03-21 18:10:05 -07:00
2026-03-04 14:48:06 -08:00
2026-04-05 20:10:54 -07:00
2026-05-11 20:55:21 -04:00
2026-04-05 17:36:37 -07:00
2026-03-04 14:48:06 -08:00
2026-05-11 22:16:11 -04:00
2026-03-04 14:48:06 -08:00
2026-03-29 21:21:18 -04:00
2026-03-10 20:53:39 -07:00
2026-05-11 19:38:21 -04:00
2026-04-08 15:40:26 -07:00
2026-02-23 19:00:57 +03:00
2026-03-20 00:20:25 -07:00
2026-04-02 15:45:19 -07:00
2026-04-05 16:31:26 -07:00
2026-04-30 09:39:54 -04:00
2026-03-21 18:10:05 -07:00
2026-05-11 05:03:34 -04:00
2026-03-29 21:21:18 -04:00
2026-05-25 14:02:05 -04:00
2026-05-18 04:11:31 -04:00
2026-03-10 19:23:00 -07:00
2026-04-01 19:41:03 -07:00
2026-03-28 20:06:42 -04:00
2026-03-16 14:03:40 -07:00
2026-05-15 02:06:46 -04:00
2026-03-29 21:21:18 -04:00
2026-05-11 08:33:00 -04:00
2026-04-01 16:09:54 -07:00
2026-03-16 13:35:50 -07:00
2026-03-22 15:40:55 -07:00
2026-03-29 21:21:18 -04:00
2026-04-05 15:42:58 -07:00
2026-03-20 00:20:20 -07:00
2026-04-05 20:05:50 -07:00
2026-03-10 20:53:39 -07:00
2026-05-14 21:37:28 -04:00
2026-04-02 02:51:24 -07:00
2026-04-02 15:45:19 -07:00
2026-02-23 19:00:57 +03:00
2026-03-29 21:21:18 -04:00
2026-03-29 21:21:18 -04:00
2026-05-11 03:35:42 -04:00
2026-06-07 13:25:29 +08:00
2026-02-23 19:00:57 +03:00
2026-05-12 14:23:46 -04:00
2026-04-05 15:27:54 -07:00
2026-02-23 19:00:57 +03:00
2026-03-03 12:32:35 -08:00
2026-04-02 15:45:19 -07:00
2026-04-02 17:48:43 -07:00
2026-04-01 02:37:42 -07:00
2026-03-29 21:21:18 -04:00
2026-04-02 17:48:43 -07:00
2026-04-08 15:40:26 -07:00
2026-03-16 13:35:44 -07:00
2026-05-25 14:02:05 -04:00
2026-03-22 15:40:53 -07:00
2026-05-11 05:03:34 -04:00
2026-04-30 09:39:54 -04:00
2026-02-23 19:00:57 +03:00
2026-03-28 20:06:42 -04:00
2026-05-12 13:20:33 -04:00
2026-02-23 19:00:57 +03:00
2026-02-23 19:00:57 +03:00
2026-02-23 19:00:57 +03:00
2026-03-29 21:21:18 -04:00
2026-03-21 18:10:05 -07:00
2026-02-23 19:00:57 +03:00
2026-03-16 14:03:40 -07:00
2026-04-02 17:48:43 -07:00
2026-06-04 21:45:13 +08:00
2026-02-23 19:00:57 +03:00
2026-05-11 21:09:20 -04:00
2026-04-05 15:19:56 -07:00
2026-04-05 16:31:26 -07:00
2026-03-29 21:21:18 -04:00
2026-03-04 14:48:06 -08:00
2026-05-11 22:16:11 -04:00
2026-03-04 14:48:06 -08:00
2026-04-05 16:12:42 -07:00
2026-05-11 05:03:34 -04:00
2026-05-11 05:03:34 -04:00
2026-05-11 07:44:26 -04:00
2026-04-05 16:31:26 -07:00
2026-05-11 01:51:24 -04:00
2026-03-20 06:40:28 -07:00
2026-02-24 14:39:25 +09:00
2026-05-25 14:09:14 -04:00
2026-05-12 14:44:17 -04:00
2026-03-29 21:21:18 -04:00
2026-06-07 13:01:21 +08:00
2026-05-11 21:43:17 -04:00
2026-03-31 22:57:48 -07:00
2026-04-30 11:26:15 -04:00
2026-03-29 21:21:18 -04:00
2026-04-05 13:30:55 -07:00
2026-02-23 19:00:57 +03:00
2026-02-23 19:00:57 +03:00
2026-04-01 02:37:42 -07:00
2026-03-27 04:02:44 +00:00
2026-03-27 04:02:44 +00:00
2026-03-29 00:04:36 -04:00
2026-03-27 04:02:44 +00:00
2026-04-28 22:10:04 -04:00
2026-04-02 17:09:21 -07:00
2026-04-05 16:10:05 -07:00
2026-05-11 13:24:05 -04:00
2026-05-11 08:00:24 -04:00
2026-05-12 21:20:53 -04:00
2026-05-12 21:20:53 -04:00
2026-05-12 21:20:53 -04:00
2026-04-05 13:30:55 -07:00
2026-03-29 21:21:18 -04:00
2026-02-27 05:50:23 -08:00
2026-04-02 15:45:19 -07:00
2026-05-11 01:51:24 -04:00
2026-03-29 21:21:18 -04:00
2026-05-25 14:02:05 -04:00
2026-05-25 14:02:05 -04:00
2026-05-25 14:02:05 -04:00
2026-05-25 14:02:05 -04:00
2026-05-12 09:30:26 -04:00
2026-04-02 18:05:27 -07:00
2026-02-23 19:00:57 +03:00
2026-04-05 13:30:55 -07:00
2026-03-10 20:53:39 -07:00
2026-03-10 21:25:52 -07:00
2026-03-10 21:25:52 -07:00
2026-03-10 21:25:52 -07:00
2026-03-12 23:53:23 -07:00
2026-03-16 13:35:23 -07:00
2026-03-28 20:41:45 -04:00
2026-03-16 13:35:23 -07:00
2026-03-16 13:35:23 -07:00
2026-03-28 20:06:42 -04:00
2026-05-25 14:02:05 -04:00
2026-04-02 02:51:24 -07:00
2026-02-24 14:39:25 +09:00
2026-04-05 16:12:42 -07:00
2026-03-29 21:21:18 -04:00
2026-05-12 14:44:17 -04:00
2026-04-01 19:41:03 -07:00
2026-02-27 05:50:23 -08:00
2026-05-25 14:10:35 -04:00
2026-04-06 14:21:28 -07:00
2026-04-05 16:31:26 -07:00
2026-05-11 18:11:05 -04:00
2026-05-12 01:47:05 -04:00
2026-05-12 01:47:05 -04:00
2026-05-12 01:47:05 -04:00
2026-05-11 22:16:11 -04:00
2026-05-11 09:14:33 -04:00
2026-03-04 14:48:06 -08:00
2026-04-02 18:27:51 -07:00
2026-05-11 08:33:00 -04:00
2026-05-11 08:33:00 -04:00
2026-05-11 08:00:24 -04:00
2026-05-11 08:00:24 -04:00
2026-05-25 14:08:41 -04:00
2026-04-05 16:12:42 -07:00
2026-03-21 18:10:05 -07:00
2026-03-20 04:44:31 -07:00
2026-05-11 02:33:29 -04:00
2026-03-31 14:06:23 -07:00
2026-05-25 14:02:05 -04:00
2026-03-10 20:42:54 -07:00
2026-03-10 20:42:54 -07:00
2026-03-10 20:42:54 -07:00
2026-05-11 20:40:39 -04:00
2026-03-21 18:10:05 -07:00
2026-03-03 12:32:35 -08:00
2026-05-25 14:02:05 -04:00
2026-05-25 14:02:05 -04:00
2026-05-14 21:37:28 -04:00
2026-04-05 16:58:02 -07:00
2026-04-05 16:59:54 -07:00
2026-05-11 08:57:53 -04:00
2026-03-29 21:21:18 -04:00
2026-04-01 02:37:42 -07:00
2026-05-12 09:30:26 -04:00
2026-02-23 19:00:57 +03:00
2026-02-23 19:00:57 +03:00
2026-03-19 20:49:34 -07:00
2026-03-29 21:21:18 -04:00
2026-05-11 21:58:52 -04:00
2026-05-11 21:58:52 -04:00
2026-05-11 21:58:52 -04:00
2026-05-11 21:58:52 -04:00
2026-03-04 14:48:06 -08:00
2026-05-28 07:32:52 -04:00
2026-05-28 07:32:52 -04:00
2026-05-28 07:32:52 -04:00
2026-05-16 03:30:30 -04:00
2026-05-25 14:02:05 -04:00
2026-05-11 05:31:12 -04:00
2026-02-23 19:00:57 +03:00
2026-04-02 17:09:21 -07:00
2026-03-28 20:29:51 -04:00
2026-04-05 16:31:26 -07:00
2026-03-29 21:21:18 -04:00
2026-03-29 21:21:18 -04:00
2026-03-20 00:29:17 -07:00
2026-03-16 13:34:25 -07:00
2026-03-28 20:06:42 -04:00
2026-03-22 15:41:04 -07:00
2026-05-11 08:16:35 -04:00
2026-05-11 11:43:35 -04:00
2026-05-11 11:43:35 -04:00
2026-05-11 08:16:35 -04:00
2026-05-11 08:16:35 -04:00
2026-05-11 05:03:34 -04:00
2026-04-05 16:13:53 -07:00
2026-05-11 05:03:34 -04:00
2026-02-23 19:00:57 +03:00
2026-04-05 15:46:01 -07:00
2026-05-11 05:31:12 -04:00
2026-05-12 14:23:46 -04:00
2026-05-11 02:33:29 -04:00
2026-04-02 02:51:24 -07:00
2026-05-25 14:11:05 -04:00
2026-02-23 19:00:57 +03:00
2026-02-23 19:00:57 +03:00
2026-02-23 19:00:57 +03:00
2026-02-23 19:00:57 +03:00
2026-05-17 23:06:35 -04:00
2026-02-23 19:00:57 +03:00
2026-02-24 14:39:25 +09:00
2026-02-23 19:00:57 +03:00
2026-02-17 17:04:31 +02:00
2026-03-29 21:21:18 -04:00
2026-06-04 21:45:13 +08:00
2026-03-31 14:05:20 -07:00
2026-04-05 16:31:26 -07:00
2026-05-14 21:18:19 -04:00
2026-03-29 00:20:04 -04:00
2026-04-01 02:25:42 -07:00
2026-05-11 06:07:46 -04:00
2026-05-17 21:48:05 -04:00
2026-04-05 15:33:26 -07:00
2026-02-23 19:00:57 +03:00
2026-03-12 14:49:05 -07:00
2026-03-29 21:21:18 -04:00
2026-03-29 21:21:18 -04:00
2026-05-11 05:31:12 -04:00
2026-05-15 08:11:30 -04:00
2026-04-01 02:37:42 -07:00
2026-05-11 05:03:34 -04:00