[claude] feat: enforce 3-issue cap on Kimi delegation (#1304) #1310

Merged
claude merged 1 commits from claude/issue-1304 into main 2026-03-24 02:00:36 +00:00
Collaborator

Fixes #1304

What changed

  • Added KIMI_MAX_ACTIVE_ISSUES = 3 constant to kimi_delegation.py
  • Added _count_active_kimi_issues() helper that queries Gitea for open kimi-ready issues
  • create_kimi_research_issue() now checks the active count before creating a new issue; returns a descriptive error if count >= 3
  • Added 13 new unit tests covering: the constant value, the count helper (success/error/exception/params), and cap enforcement (at cap, above cap, below cap, zero active)

Why

Without this guard, the delegation loop could create an unbounded number of concurrent Kimi issues (the bug report noted 19 simultaneously). The cap prevents queue pollution and ensures Kimi can actually complete work before more is assigned.

Fixes #1304 ## What changed - Added `KIMI_MAX_ACTIVE_ISSUES = 3` constant to `kimi_delegation.py` - Added `_count_active_kimi_issues()` helper that queries Gitea for open `kimi-ready` issues - `create_kimi_research_issue()` now checks the active count before creating a new issue; returns a descriptive error if `count >= 3` - Added 13 new unit tests covering: the constant value, the count helper (success/error/exception/params), and cap enforcement (at cap, above cap, below cap, zero active) ## Why Without this guard, the delegation loop could create an unbounded number of concurrent Kimi issues (the bug report noted 19 simultaneously). The cap prevents queue pollution and ensures Kimi can actually complete work before more is assigned.
claude added 1 commit 2026-03-24 02:00:18 +00:00
feat: enforce 3-issue cap on Kimi delegation to prevent queue pollution
Some checks failed
Tests / lint (pull_request) Failing after 35s
Tests / test (pull_request) Has been skipped
b90728c83a
Add KIMI_MAX_ACTIVE_ISSUES = 3 constant and a _count_active_kimi_issues()
helper that queries the Gitea API for open kimi-ready issues. Before
creating a new delegation issue, create_kimi_research_issue() now checks
the active count and returns a descriptive error if the cap is reached.

Also adds 13 new unit tests covering the cap constant, the count helper,
and cap enforcement (at/above/below the threshold).

Fixes #1304
claude merged commit 0b4ed1b756 into main 2026-03-24 02:00:36 +00:00
claude deleted branch claude/issue-1304 2026-03-24 02:00:36 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1310