Commit Graph

8 Commits

Author SHA1 Message Date
6856f10c27 fix(adapter/llm): make max_tokens configurable via team.yaml models.default_max_tokens 2026-03-15 18:55:57 -04:00
e097f4be21 feat(core): implement TeamRunner orchestration loop
Full T1→T5 pipeline orchestration with adapter registry, escalation,
and blackboard event emission.

Key design decisions:
- Adapter registry maps config keys to concrete classes; VCS and notify
  are optional (swallow init errors and degrade gracefully)
- _dispatch_brief() routes to LLM adapter (standard) or coding runtime
  (coding_agent) based on brief.preferred_runtime
- _run_with_escalation() drives the retry/salvage loop: persists amended
  briefs to the Blackboard before each re-submission
- Tier parsers (_parse_t1/t2/t3_output) build child TaskBriefs, preserving
  the goal_anchor invariant and resolving agent personalities from the registry
- T5 Verifier is always spawned after T4; VCS commit only happens on
  verified pass (status "passed" or "done")
- --dry-run flag: logs all actions, skips LLM, VCS, and notify calls
- Exposes CLI via `python -m core.team_runner` with --config, --dry-run,
  --verbose flags

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 03:15:37 -04:00
97e7be80d1 feat(adapter/runtime): implement OpenClaw and ClaudeCode runtime adapters
OpenClawRuntimeAdapter:
- spawn() shells out to `openclaw session spawn --task <t> --mode run`
- get_result() polls `openclaw session get <id>` until terminal status or timeout
- kill() calls `openclaw session kill <id>`, silently succeeds if finished
- Parses JSON or raw-text session IDs; raises NotImplementedError with
  helpful message when openclaw CLI is absent from PATH

ClaudeCodeRuntimeAdapter:
- spawn() launches `claude --permission-mode bypassPermissions --print <task>`
  in a temp dir (or context["workdir"]), returns a UUID job_id
- Tracks all Popen instances in a thread-safe dict
- get_result() calls communicate(timeout=...), raises TimeoutError on timeout
- kill() terminates the Popen; silently ignores already-finished processes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 03:15:21 -04:00
c88c4309ac feat(adapter/notify): implement OpenClawNotifyAdapter
Sends notifications via `openclaw system event --text <msg> --mode now`.
- Always logs locally (info/warning/error) regardless of CLI availability
- Gracefully handles FileNotFoundError (openclaw not on PATH) and
  TimeoutExpired; notifications are best-effort and never crash the pipeline
- OPENCLAW_SIGNAL_NUMBER env var stored for future direct-signal support

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 03:15:13 -04:00
b212082b58 feat(adapter/vcs): implement GitHubAdapter
Uses PyGithub to interact with the GitHub REST API.
- Reads GITHUB_TOKEN from env; parses owner/repo from SSH or HTTPS URL
- create_branch() creates a branch off the configured base branch
- commit() accepts dict[str, str] {path: content} or list[str] of
  local paths; uses Contents API (create_file / update_file)
- create_pr() and get_pr_status() delegate to PyGithub pull-request API

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 03:15:06 -04:00
9646a146bc feat(adapter/llm): implement AnthropicAdapter
Implements AnthropicAdapter using the anthropic SDK.
- Reads ANTHROPIC_API_KEY from env; raises ValueError if missing
- resolve_model() looks up capability_map in team.yaml config,
  falls back to "capable" tier then hard-coded claude-sonnet-4-6
- complete() supports system_prompt, max_tokens (default 4096),
  and temperature (default 0) via the context dict
- Adds PyGithub to requirements.txt (needed by GitHubAdapter)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 03:15:01 -04:00
70f1c2f49e chore: point agents submodule at forked repo for resilience 2026-03-15 02:34:11 -04:00
eaf7fd8f6f feat: initial bootstrap — structure, task_brief, blackboard, adapter bases, escalation, prompts
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 02:19:14 -04:00