feat: wire delegate_task to DistributedWorker for actual execution
Some checks failed
Tests / lint (pull_request) Successful in 34s
Tests / test (pull_request) Failing after 29m15s

Fixes #985

- Create src/brain/__init__.py and src/brain/worker.py with DistributedWorker
- DistributedWorker routes tasks to three backends:
  - agentic_loop: local multi-step execution (default)
  - kimi: heavy research via Gitea kimi-ready issues (when gitea_enabled + exceeds_local_capacity)
  - paperclip: task submission via Paperclip API (when paperclip_api_key configured)
- Implements task lifecycle: queued → running → completed | failed
- Auto-retry with exponential fallback (MAX_RETRIES=2) on failure
- delegate_task now returns real task_id instead of None/"noted"
- Add brain package to pyproject.toml packages list
- Add 32 unit tests covering task submission, routing, lifecycle, and integration

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Alexander Whitestone
2026-03-23 21:39:32 -04:00
parent 2b238d1d23
commit efa899efb2
5 changed files with 577 additions and 5 deletions

1
src/brain/__init__.py Normal file
View File

@@ -0,0 +1 @@
"""Brain — identity system and task coordination."""