42 lines
1.4 KiB
Python
42 lines
1.4 KiB
Python
"""Agent dispatcher — route tasks to Claude Code, Kimi, APIs, or Timmy itself.
|
|
|
|
Timmy's dispatch system: knows what agents are available, what they're good
|
|
at, and how to send them work. Uses Gitea labels and issue comments to assign
|
|
tasks and track completion.
|
|
|
|
Dispatch flow:
|
|
1. Match task type to agent strengths
|
|
2. Check agent availability (idle or working?)
|
|
3. Dispatch task with full context (issue link, requirements, criteria)
|
|
4. Log assignment as a Gitea comment
|
|
5. Monitor for completion or timeout
|
|
6. Review output quality
|
|
7. If output fails QA → reassign or escalate
|
|
|
|
Agent interfaces:
|
|
- Claude Code → ``claude-ready`` Gitea label + issue comment
|
|
- Kimi Code → ``kimi-ready`` Gitea label + issue comment
|
|
- Agent APIs → HTTP POST to external endpoint
|
|
- Timmy (self) → direct local invocation
|
|
|
|
Usage::
|
|
|
|
from timmy.dispatcher import dispatch_task, TaskType, AgentType
|
|
|
|
result = await dispatch_task(
|
|
issue_number=1072,
|
|
task_type=TaskType.ARCHITECTURE,
|
|
title="Design the LLM router",
|
|
description="We need a cascade router...",
|
|
acceptance_criteria=["Failover works", "Metrics exposed"],
|
|
)
|
|
|
|
.. note::
|
|
|
|
This module is a backward-compatibility shim. The implementation now
|
|
lives in :mod:`timmy.dispatch`. All public *and* private names that
|
|
tests rely on are re-exported here.
|
|
"""
|
|
|
|
from timmy.dispatch import * # noqa: F401, F403
|