Skip to content

feat: add nano team mode — LLM-planned multi-worker async collaboration#2013

Open
pancacake wants to merge 5 commits intoHKUDS:mainfrom
pancacake:feat/nano-team-mode
Open

feat: add nano team mode — LLM-planned multi-worker async collaboration#2013
pancacake wants to merge 5 commits intoHKUDS:mainfrom
pancacake:feat/nano-team-mode

Conversation

@pancacake
Copy link
Copy Markdown
Collaborator

@pancacake pancacake commented Mar 14, 2026

Summary

  • Add Nano Team Mode: given a goal, the LLM automatically plans a 2-3 member micro-team where each member runs as an independent async worker, collaborating through a shared task board and mailbox
  • Add nanobot/agent/team/ module: TeamManager (lifecycle & scheduling), state.py (pure dataclasses), board.py (file-locked task board), mailbox.py (JSONL message bus with auto-truncation), tools.py (TeamTool + TeamWorkerTool), _filelock.py (cross-platform file locking)
  • Extract build_base_tools() factory to eliminate duplicated tool registration across loop.py / subagent.py / team; move parse_json_from_llm() to utils/helpers.py

Highlights

  • /team <goal> to start, /team status / /team log / /team stop to manage
  • CLI live board panel + approval push notifications for Telegram and other channels
  • Natural language approval (bilingual keyword matching)
  • Risk gate: destructive instructions are auto-paused, require /team confirm to proceed
  • Disk persistence + auto-attach on process restart

Test Plan

  • test_team_mode.py — TeamManager core: plan validation, fallback, session isolation, lifecycle, approval flow
  • test_team_routing.py — AgentLoop command routing: all /team subcommands, aliases, approval, Telegram interception
  • test_cli_input.py — CLI team view rendering and suppress logic

@Re-bin Re-bin self-requested a review March 14, 2026 15:11
@Re-bin
Copy link
Copy Markdown
Collaborator

Re-bin commented Mar 14, 2026

Thanks @pancacake

Introduce a self-organizing team system where the LLM plans a 2-3 member
team from a user goal, then each member runs as an independent async worker
coordinating through a shared task board and mailbox.

Key components:
- team/state.py: pure dataclasses (Task, Teammate, Mail, TeamState)
- team/board.py: file-locked task board (claim/complete/approve/reject)
- team/mailbox.py: JSONL message bus with auto-truncation (200 msgs)
- team/tools.py: TeamTool (leader) + TeamWorkerTool (worker) for LLM
- team/_filelock.py: cross-platform file locking (Unix fcntl / Win msvcrt)
- team/__init__.py: TeamManager lifecycle, planning, worker scheduling

Also includes:
- build_base_tools() factory to deduplicate tool registration
- parse_json_from_llm() extracted to utils/helpers.py
- CLI team panel with live board view
- /team commands in AgentLoop for all channels
- Risk gate for destructive instructions
- Full test coverage (test_team_mode, test_team_routing, test_cli_input)

Made-with: Cursor
@pancacake pancacake force-pushed the feat/nano-team-mode branch from 24d4567 to d2c7a6e Compare March 20, 2026 07:19
Re-bin added 4 commits March 24, 2026 04:10
- Resolve 4 conflict files (loop.py, commands.py, schema.py, test_cli_input.py)
- Migrate ~190 lines of inline team commands from loop.py into nanobot/command/team.py
- Update cmd_stop/cmd_new in builtin.py for team cancellation and metadata cleanup
- Fix TelegramConfig import path, missing datetime import, dead `import re`
- Add /teams exact alias, update /help with team command listing
- All 617 tests pass
Resolve config schema overlap by keeping both team-mode worker settings from pr-2013 and the new timezone default from main.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants