[claude] Implement Kimi delegation for heavy research via Gitea labels (#979) #1085

Merged
Rockachopa merged 2 commits from claude/issue-979 into main 2026-03-23 15:14:54 +00:00
Collaborator

Fixes #979

What this does

Implements the full Kimi delegation pipeline for heavy research tasks:

  • exceeds_local_capacity() — heuristic using keyword detection + word-count threshold to decide when to delegate
  • _build_research_template() — fills a structured markdown body for the Gitea issue
  • create_kimi_research_issue() — creates a Gitea issue labelled kimi-ready (auto-creates the label if missing)
  • poll_kimi_issue() — monitors the issue until Kimi closes it or a timeout is reached
  • index_kimi_artifact() — stores Kimi's artifact into Timmy's semantic memory via store_memory()
  • extract_and_create_followups() — parses checkbox/numbered/Action: items and files follow-up Gitea issues
  • delegate_research_to_kimi() — top-level entry point used by agents

Tests

Adds tests/unit/test_kimi_delegation.py with 57 tests covering all pure functions and async paths (httpx, settings, and memory_system mocked).

Delegation flow

Step Actor Action
1 Timmy exceeds_local_capacity() returns True
2 Timmy delegate_research_to_kimi() fills template
3 Timmy create_kimi_research_issue() creates kimi-ready issue
4 Kimi Picks up, executes research, commits artifact
5 Kimi Closes the issue
6 Timmy poll_kimi_issue() detects closed state
7 Timmy index_kimi_artifact() stores to semantic memory
8 Timmy extract_and_create_followups() creates next steps
Fixes #979 ## What this does Implements the full Kimi delegation pipeline for heavy research tasks: - **`exceeds_local_capacity()`** — heuristic using keyword detection + word-count threshold to decide when to delegate - **`_build_research_template()`** — fills a structured markdown body for the Gitea issue - **`create_kimi_research_issue()`** — creates a Gitea issue labelled `kimi-ready` (auto-creates the label if missing) - **`poll_kimi_issue()`** — monitors the issue until Kimi closes it or a timeout is reached - **`index_kimi_artifact()`** — stores Kimi's artifact into Timmy's semantic memory via `store_memory()` - **`extract_and_create_followups()`** — parses checkbox/numbered/Action: items and files follow-up Gitea issues - **`delegate_research_to_kimi()`** — top-level entry point used by agents ## Tests Adds `tests/unit/test_kimi_delegation.py` with 57 tests covering all pure functions and async paths (httpx, settings, and memory_system mocked). ## Delegation flow | Step | Actor | Action | |------|-------|--------| | 1 | Timmy | `exceeds_local_capacity()` returns True | | 2 | Timmy | `delegate_research_to_kimi()` fills template | | 3 | Timmy | `create_kimi_research_issue()` creates `kimi-ready` issue | | 4 | Kimi | Picks up, executes research, commits artifact | | 5 | Kimi | Closes the issue | | 6 | Timmy | `poll_kimi_issue()` detects closed state | | 7 | Timmy | `index_kimi_artifact()` stores to semantic memory | | 8 | Timmy | `extract_and_create_followups()` creates next steps |
claude added 2 commits 2026-03-23 15:12:38 +00:00
feat: implement Kimi delegation for heavy research via Gitea labels (#979)
Some checks failed
Tests / lint (pull_request) Failing after 12s
Tests / test (pull_request) Has been skipped
e23fb6fdcc
Adds kimi_delegation.py with the full delegation pipeline:
- exceeds_local_capacity() heuristic (keywords + word-count threshold)
- _build_research_template() fills structured markdown issue body
- create_kimi_research_issue() creates a Gitea issue labelled `kimi-ready`
  and auto-creates the label if it doesn't exist
- poll_kimi_issue() monitors the issue until Kimi closes it or timeout
- index_kimi_artifact() stores Kimi's artifact in Timmy's semantic memory
- extract_and_create_followups() parses action items and files follow-up issues
- delegate_research_to_kimi() top-level entry point

Adds 57-test suite covering all pure functions and async paths with
httpx/settings/memory_system mocked.

Fixes #979

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rockachopa merged commit e482337e50 into main 2026-03-23 15:14:54 +00:00
Rockachopa deleted branch claude/issue-979 2026-03-23 15:14:54 +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#1085