feat(config): pipeline + watchdog thresholds driven by agents.json #453

Closed
opened 2026-04-27 13:49:27 +00:00 by claude-desktop · 0 comments
Collaborator

User story

As an operator, I want pipeline stall thresholds, review round caps, watchdog intervals, WIP soft limits, and dead-letter thresholds in agents.json, so that I can tune SLAs per-deployment without recompiling.

Why: these defaults live as consts in webhook-config.ts:1345-1452, review-loop.ts:49, container-watchdog.ts:106, tail-pr-rebase-watchdog.ts:62, dispatch/watchdog.ts:49. A faster (or slower) machine needs different defaults; today the only knob is editing source.

Acceptance criteria

Schema

  • agents.json::pipeline block:
    • stall_threshold_ms: number (default 600_000)
    • ci_threshold_ms: number (default 600_000)
    • review_threshold_ms: number (default 900_000)
    • implement_threshold_ms: number (default 1_800_000)
    • default_threshold_ms: number (default 1_800_000)
    • max_review_rounds: number (default 3)
  • agents.json::watchdogs block:
    • container_interval_sec: number (default 60)
    • tail_pr_rebase_interval_ms: number (default 60_000)
    • dead_letter_threshold: number (default 3)
    • janitor_interval_ms: number (default 600_000)
  • agents.json::types.<TYPE>.wip_soft_limit: number (default 4)
  • agents.json::types.<TYPE>.max_escalations_per_day: number (default 10)

Code

  • All listed consts replaced with reads from resolved config
  • Duplicate MAX_ROUNDS = 3 in review-loop.ts:49 removed (use pipeline config)

Tests

  • Existing watchdog/pipeline tests pass with config-driven values
  • New test: overriding stall_threshold_ms in mock config changes stall detection cutoff

Out of scope

  • Live-reload on config change (next-dispatch reload is fine)
  • Per-instance overrides (per-type only for now)

References

  • webhook-config.ts:1345-1452
  • domain/workflow/review-loop.ts:49
  • infrastructure/container/container-watchdog.ts:106
  • background/tail-pr-rebase-watchdog.ts:62
  • domain/dispatch/watchdog.ts:49
  • Audit category 7 (HIGH + MED)
## User story As an operator, I want pipeline stall thresholds, review round caps, watchdog intervals, WIP soft limits, and dead-letter thresholds in `agents.json`, so that I can tune SLAs per-deployment without recompiling. **Why:** these defaults live as `const`s in `webhook-config.ts:1345-1452`, `review-loop.ts:49`, `container-watchdog.ts:106`, `tail-pr-rebase-watchdog.ts:62`, `dispatch/watchdog.ts:49`. A faster (or slower) machine needs different defaults; today the only knob is editing source. ## Acceptance criteria ### Schema - [ ] `agents.json::pipeline` block: - `stall_threshold_ms: number` (default 600_000) - `ci_threshold_ms: number` (default 600_000) - `review_threshold_ms: number` (default 900_000) - `implement_threshold_ms: number` (default 1_800_000) - `default_threshold_ms: number` (default 1_800_000) - `max_review_rounds: number` (default 3) - [ ] `agents.json::watchdogs` block: - `container_interval_sec: number` (default 60) - `tail_pr_rebase_interval_ms: number` (default 60_000) - `dead_letter_threshold: number` (default 3) - `janitor_interval_ms: number` (default 600_000) - [ ] `agents.json::types.<TYPE>.wip_soft_limit: number` (default 4) - [ ] `agents.json::types.<TYPE>.max_escalations_per_day: number` (default 10) ### Code - [ ] All listed `const`s replaced with reads from resolved config - [ ] Duplicate `MAX_ROUNDS = 3` in `review-loop.ts:49` removed (use pipeline config) ### Tests - [ ] Existing watchdog/pipeline tests pass with config-driven values - [ ] New test: overriding `stall_threshold_ms` in mock config changes stall detection cutoff ## Out of scope - Live-reload on config change (next-dispatch reload is fine) - Per-instance overrides (per-type only for now) ## References - `webhook-config.ts:1345-1452` - `domain/workflow/review-loop.ts:49` - `infrastructure/container/container-watchdog.ts:106` - `background/tail-pr-rebase-watchdog.ts:62` - `domain/dispatch/watchdog.ts:49` - Audit category 7 (HIGH + MED)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks#453
No description provided.