feat(multi-agent): teams.yml and rooms with agent, block and human members, plus cron routines
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 15/100
Research direction
Start by reading AGENTS.md section 0, docs/architecture/decisions.md, and the existing pipeline.yaml loader; the issue names tether/team.py as the corresponding entry point. The proposal spans teams, rooms, member types, message delivery, SQLite storage, CLI/MCP commands, cron routines, and tests, so first map those existing systems and the phase boundaries. Done means the proposed phases are implemented with decisions recorded in the PRs, and the team lane has its own measurement.
Written by the indexing model from the issue text.
Description
Summary
Today tether only has hub-and-spoke orchestration (AD-40): a parent spawns children and reads digests, and siblings never talk to each other. This issue adds peer collaboration around one primitive, the room: a shared, ordered message log whose members are agents, deterministic blocks and humans. Members post typed messages, wake each other through mentions and subscriptions, and read a shared context board first. Cron drives time-based work.
The goal is also a small-model lane: many tiny tasks, each fitting in a small context window, that cooperate through bounded messages instead of one long transcript. ollama/qwen3.5:9b is the design target (weakest-model rule); stronger models use the same code path.
Core ideas (from the product owner):
- An agent is a "super tool": a tether instance with its own model, tools and contract, defined once in
teams.ymland spawned when needed. - Not every member needs a model. A block (probe, fetch, compare, format, notify) does deterministic work and posts the result for agents to pick up.
- A human is a member too: ask how it is going, nudge a member, answer its questions, or leave context for "whoever needs it".
Order: this issue comes first. The external-UI API (tether serve, #387) is blocked by it and starts only once every phase here has merged, so the API is designed against the finished room, team and routine model.
Everything below is a proposed default. Per AGENTS.md section 0, each decision is recorded in docs/architecture/decisions.md (new AD-n, open questions as OQ-n) in the PR that introduces it.
Why (evidence)
- Free peer teams cost more and fail more: in Mieczkowski et al. 2026 (2603.12229) self-coordinating LLM teams reached a median 0.88x speedup against 1.36x for preassigned teams, with a median 19 failed tests against 4 (concurrent writes, rewrites, tasks started before their dependencies were done), and token cost grew with team size while speed did not. Speedup is bounded by how parallel the task is (Amdahl).
- Anthropic's multi-agent research system: about 15x the tokens of a chat; vague delegation made subagents duplicate work; poor fit for tasks with shared context or many dependencies.
- Failures are mostly coordination, not model capability (Why Do Multi-Agent LLM Systems Fail?).
- Messages between agents are a prompt-injection path (Mind Viruses).
- OpenBot (CopilotKit) and Grok Bot both keep a human in the loop and put a deterministic gateway around agents. Neither shows free peer chat working.
Conclusion: the room's conversation is free-form, but its envelope (membership, wake rules, budgets, caps, termination, security) is deterministic and never delegated to a model (Philosophy Gate 3). Work that does not need judgment is done by blocks, not by models.
Philosophy Gate check
| Line | How this design satisfies it |
|---|---|
| Lightweight | stdlib + SQLite only; no broker, no daemon, no new dependency (Rule 7). |
| Token saver | 0 static prompt tokens added; rooms are read by cursor, never pushed; at most one short [room: ...] line per step; blocks cost no tokens; sleeping agents cost nothing. |
| Reliable | hard caps and budgets, ping-pong guard, dead-worker notices, explicit termination, deterministic status. |
| Extensible | members are config (teams.yml + skills + @tool), not harness special cases. |
| Model-agnostic | each agent is any <provider>/<model>; small and frontier models take the same path. |
| Easy to use | tether team run teams.yml "<goal>"; zero-config defaults for every cap. |
| Resourceful | reuses sessions, inbox, FTS5, pins, agent send, worktrees, file_snapshots, --output-schema, tether mcp. |
North Star link: this is a separate lane (broad tasks and small-model decomposition), not the Polyglot single-agent number, which it is not expected to move. It must not regress it (nothing changes when no team is used). The lane gets its own measurement (phase 6).
Design
1. teams.yml: members of three kinds
Next to pipeline.yaml (same loader style, tether/team.py).
name: fx-watch
lead: human # human | <member name> (default: human = the caller)
room:
max_messages: 60 # messages per room before it is handed back
max_tokens: 200000 # shared budget (prompt + completion) across all agent members
message_chars: 600 # longest message body kept inline (longer = stored, pointer in room)
limits:
max_depth: 1 # an agent may spawn members only if > 0
max_agents: 6 # live agent members per run
max_fanout: 4 # spawns per agent
members:
fx: # a deterministic block: no model, no tokens
kind: block
run: "web fetch https://<fx-api>/latest#rates/<cur>"
every: "*/30 * * * *"
post: data
only_if: { pin: last_fx, change_pct_gte: 0.5 }
news: # an agent
kind: agent
description: Find news that could move the dollar # one line, listed to peers (<= 12 tokens)
model: ollama/qwen3.5:9b
tools: [web]
wakes_on: [data@fx]
input: "a price move"
output: "3 bullets with source URLs"
budget: { max_steps: 20, max_tokens: 60000 }
summarizer:
kind: agent
model: ollama/qwen3.5:9b
wakes_on: [result@news, "#alerts"]
output_schema: alert.json # sources + confidence required (reuses --output-schema)
notify: # a block that sends, only the harness holds the credentials
kind: block
on: result@summarizer
run: "<sink>"
max_per_day: 4
me: # a human member
kind: human
routines:
- name: fx-tick
cron: "*/30 * * * *"
team: fx-watch
goal: "Check the dollar and report if it moved"
Rules:
- Every key has a default, validation errors read
teams.yml: ...and say what to do next (likeproviders.yaml). - A member's sandbox is
root.attenuate(member.sandbox): it can only narrow (Rule 6).teams.ymlis read from the caller's explicit path, never discovered inside the workspace. - The roster is fixed when a session starts, so the prompt prefix and
toolsarray never mutate mid-session (Rule 1). Each peer costs one line (- news: Find news that could move the dollar). - Blocks are defined by the human in
teams.yml. An agent can never create or edit a block. A block's command runs under itsSandboxPolicy; anything that needs to leave the jail still requires the allowlist or the caller's approval (Rule 6).
2. Member kinds
| agent | block | human | |
|---|---|---|---|
| What it is | a tether session with a model | a deterministic command, @tool function or web fetch, run in the same sandbox |
the caller or any person with access to the project |
| Tokens | yes | none | none |
| Posts | ask, answer, note, result |
data, note, result (structured payload) |
any type, from the CLI or MCP |
| Wakes | on a mention or a subscription | on a cron tick or a subscription | never; reads when it wants (tether inbox) |
| Bounds | steps and token budget | timeout, output cap, rate cap | n/a |
- A sleeping agent is a
WAITING_INPUTsession. The room resumes it through the existingsendmechanism, so no process stays running. - A block's full output is stored as an observation; the room message carries a short preview and a pointer (
mem recall <obs>style), so the room stays cheap. - An agent may call a block on demand (
room say @fx run), which brings back the original "super tool" idea with two kinds of tool: deterministic and agent.
3. Rooms
A room is a SQLite table, not a new service.
rooms(id, team, goal, lead, status, max_messages, max_tokens, created_at, updated_at)
room_members(room_id, session_id NULL, name, kind, wakes_on_json, cursor, joined_at) -- kind: agent|block|human
room_messages(id INTEGER PK AUTOINCREMENT, room_id, sender, to_name NULL, topic NULL, type,
reply_to NULL, pinned INTEGER DEFAULT 0, body, payload_obs NULL, created_at)
-- type: ask|answer|note|result|data
- Total order for free:
idis the room's order, so every member sees the same sequence. - Typed messages:
ask(expects ananswer, optional deadline in steps),answer(reply_toan ask),note,result(a member's deliverable),data(a block's structured payload). - FTS5: message bodies are indexed in
chunks_fts(source_type = 'room') somem searchandagent querycan search the history. - Everyone in the room can read everything (no private messages in v1).
- Agent commands (built in for agent members, behind the single
actprimitive, Rule 2):room say [@name | #topic] [--ask|--answer <id>] [--pin] <text>(long text through stdin),room read [--all](unread by cursor, bounded),room who,room search <query>.--helpstays within 60 tokens (Rule 4). - Reading is pull, not push (Rule 5): after each step the harness appends at most one line to the observation:
[room: 2 new, 1 for you | room read](0 static prompt tokens, no model call). Unread cursors live inroom_members. Old room reads fold like any observation.
4. Addressing and waking (deterministic)
Who gets woken is decided by the harness from the message envelope, never by a model:
| A message with... | Effect |
|---|---|
@name (mention) |
stored; wakes that member (injected like send for a running agent, resumes it if asleep) |
#topic |
stored; wakes every member whose wakes_on lists that topic |
| nothing | stored and passive: nobody wakes; it counts in everyone's [room: N new] line and is read when a member chooses to ("anyone pick it up if they need") |
--pin |
also placed on the room's context board |
wakes_on entries are type@sender (e.g. data@fx, result@news) or #topic. @lead is an alias for whoever leads the room.
Context board (memory/context information that models look first): pinned messages form a small board per room (bounded, default 800 chars rendered, newest pinned last; reuses the semantics of mem pin). A member's first room read, and any room wake-up, shows the board first. Humans, blocks and agents may pin. This is where "the user prefers X", "the price is stored in pin last_fx" or "ignore source Y" lives, so a tiny task does not need the history.
5. Humans as members
tether room say <room> [@name | #topic] [--ask] [--pin] "<text>"posts as the human; the same from MCP (tether_room_say).- Nudge or steer a member:
@coder please use the existing parser, injected before that agent's next step (existing inbox mechanism). - Answer a question: an agent's
ask @mepauses it asWAITING_INPUT(reusesdone --ask) and shows intether inbox; the human'sanswerresumes it. - Ask how it is going, for free:
tether room status [<name>]is a deterministic status (step count, last command, recent events, tokens used, waiting on what), no model call. A human message@coder how is it going?is the model-answered variant. - Leave context for anyone: an untargeted message (passive) or a pinned one.
- Take-over lock:
tether room takeover <name>pauses a member's model while the human drives it; other members' messages to it queue. - Approvals stay with the caller (Rule 6): a room message can never approve another member's
[APPROVAL NEEDED].
6. The lead: agent or human (default human)
lead: human(default): the caller leads and sees everything. Only the lead closes the room (tether room close <id>ordonefrom the lead session).lead: <member>: an agent leads, receives everyresult, and maydonethe room. The human remains a member who can read, post, pause, stop and take over.- Completion is explicit either way: a room never ends because agents agreed. Without a lead action it ends only at a cap and is handed back as
WAITING_INPUT(exit code 2) with a digest.
7. Starting members
- Human starts a team:
tether team run teams.yml "<goal>" [--detach]creates the room and starts the members the lead needs (blocks and sleeping agents are registered, not run). - An agent spawns members:
agent spawn --team <name> <member> <goal>(named-member form ofagent spawn), allowed only withinlimits; the child joins the parent's room. agent spawnwithout a team keeps working exactly as today (AD-40).
8. Small-model design (the point of the lane)
- Tiny tasks: member
budgetdefaults tomax_steps 30; a member's goal is itsinputcontract plus the board, not the whole project history. - Bounded messages:
message_chars(600 default) per message; larger payloads are stored once and referenced. - Board first, history on demand: a member starts from the pinned board and its unread count, and pulls more with
room read/room search. - Sleep between tasks: a member that has posted its
resultends; a fresh task is a fresh, small context. - Blocks absorb the mechanical work (fetch, compare, format, send), so the 9B model only reads and judges.
- Phase 6 measures this claim, not assumes it (below).
9. Deterministic envelope (proposed defaults)
- Spawn caps:
max_depth 1,max_agents 6,max_fanout 4; exceeding one is a tool error that says which cap and what to do (self-healing, not a crash). - Budgets: room
max_messages 60, sharedmax_tokensacross agent members (reuses--max-tokensaccounting); at the limit the room endsWAITING_INPUTwith[ROOM BUDGET], andsendgrants the same amount again. - Ping-pong guard (like
cycle_stall): the same two members trading 6 messages in a row with no file change between them get one[WRAP UP], then the room is handed back to the lead. - Loops between blocks: block and agent posts count toward the message cap; an identical
datamessage from the same sender within the dedupe window is dropped. - Unanswered
ask: after its deadline in steps the asker is told[no answer from <name>]. - Dead or stuck member: the existing worker reaping posts a
note(<name> died (pid N)); a stall-guard hand-back is posted the same way and asks the lead. - Shared files: default
worktree: truefor agent members that write; each branch istether/<id>; merge is the lead's or the human's job (AD-39: the model never gets git).tether diffper member already works throughfile_snapshots.
10. Security
- Messages and block payloads from others are untrusted data: rendered with an origin label (
[news]), never merged into the system prefix, never able to widen a sandbox or grant an approval. - A member's sandbox is fixed at spawn (narrow only).
agent spawn --teamcannot raise tools or network above its parent's. - Outbound sinks (notify) are outward-facing: declared by the human in
teams.yml, host-allowlisted, credentials read by the harness from env names (never values in the file,TETHER_ENV_PASSTHROUGH), never chosen by an agent, rate-limited (max_per_day, quiet hours). - Existing secret scrubbing applies to message bodies before they are stored and indexed.
- Room tables live in the same DB, which is already protected from
bash/edit(AD-55).
11. Routines and watchers (cron driven, no daemon)
routines:inteams.yml(ortether routine add ...) are stored in aroutinestable.- Driver:
tether routines tickruns every due routine and every dueevery:block once, then drains pending room wake-ups, and exits. The user schedules it with cron, systemd timer or CI (* * * * * tether routines tick). No resident process. Alsotether routines list|run <name>|enable|disable. - Reactive chains run inline: whichever process posts a message runs the subscribed blocks and resumes the subscribed agents right away; cron only provides time triggers.
- Each firing starts a fresh team run (own room), or posts into a standing room if
deliver_tois set. - Quiet is free: a block with
only_ifthat does not hold posts nothing, so no agent wakes and no model token is spent. - Guards: minimum interval 15 minutes (blocks may be shorter, they cost no tokens), at most 20 enabled routines, skip a firing while the previous one is still running (recorded, not queued), auto-disable after 10 consecutive failures with a clear status.
- Cron parsing is a small stdlib parser (5 fields,
*, lists, ranges, steps). - State between runs: project pins (
mem pin --project) hold the last value and "already reported" markers. - Evidence: summaries use
--output-schema(sources plus confidence required); a deterministic check confirms the cited URLs were fetched in the session.
12. Observability and interfaces
tether inbox: every session in the project that isWAITING_INPUT, with its question and room (also an MCP tool).tether room list|show|tail|say|status|close|pause|resume|mute <name>|kick <name>|takeover <name>.tether statsgains per-member and per-room rows: tokens, messages, idle steps, ping-pong events, asks answered/unanswered, spawn-cap hits, block runs and dedupe drops.tether export <room>as a Markdown transcript;tether retro <room>distils at most two learned rules from the room's friction (offline, AD-43).- MCP:
tether_room_say,tether_room_read,tether_room_list,tether_room_status,tether_team_runso an outside orchestrator (e.g. Claude Code) can join a room. - Message and task state names stay close to A2A (task, message, artifact, state) so a future optional adapter is possible. Not in scope: A2A, AG-UI, HTTP servers.
Implementation plan (one PR per phase, each with docs, golden traces, e2e scenario and 100% coverage required by AGENTS.md)
teams.ymlwith members and caps:tether/team.pyloader and validation (kinds agent|block|human),agent spawn --team, depth/fan-out/total caps, narrowing sandbox, shared token budget. Tests: schema errors, caps, sandbox monotonicity, token-budget hand-back.- Rooms, addressing and the board: tables,
roomtool (say/read/who/search), typed messages, cursors, mention/topic/passive wake rules, pinned context board shown first,[room: ...]nudge, FTS5 indexing,tether room ...CLI, human members,tether inbox,room status, lead (human/agent) and close/hand-back. Token-budget tests (prompt stays < 150 tokens;room --help<= 60 tokens; nudge <= 200 chars). Golden traces for the nudge and the board. - Blocks: command/fetch/
@toolblocks,post,on/wakes_onsubscriptions,only_ifwith pins, output cap and preview-plus-pointer, dedupe, origin labelling. E2E with scripted block output and scripted model replies through the fault-injecting proxy (assert what tether sends and records, not model skill). - Envelope and human controls: ping-pong guard, ask deadlines, dead/stuck member notices, pause/mute/kick/takeover, worktree-per-member default, peer-message security tests.
- Routines and watchers:
routinestable, cron parser,tether routines tick|list|run|enable|disable, due-block evaluation, guards,notifysinks with host allowlist, daily caps and quiet hours. Tests with a fake clock. - Evidence and docs: (a) mixed-task benchmark (two long independent subtasks with occasional cross-questions) comparing one agent, parent/child and a room on tokens, wall-clock and result quality; (b) the small-model claim: the same broad task done by one
qwen3.5:9bagent versus a room ofqwen3.5:9bmembers with blocks and a board, same default config. Reported under its ownnorth star:lane line, flat results reported honestly. Docs-site Guide, Concept page (problem, research above, what tether does, what we got), reference pages, atether team init fx-watchstarter example, README mention, release notes,AD-n/OQ-nentries.
Acceptance criteria
- With no
teams.yml, behaviour, prompts and golden traces are unchanged. - A block-to-agent chain works scripted: a block posts
data, the subscribed agent wakes, answers, and a notify block sends once (and not again within the dedupe window). - A
@mentionwakes only its target,#topicwakes only subscribers, and an untargeted human message wakes nobody but appears in everyone's unread count. - A pinned message appears on the board and is shown before history on a member's first read.
tether room statusanswers without any model call.- A human
askanswered throughtether room say --answerresumes the waiting agent. - Every cap and budget ends the room in a clear, resumable
WAITING_INPUT; no scenario hangs. - A message or block payload cannot grant an approval or widen a sandbox (test).
tether routines tickfires due routines once, skips overlaps and auto-disables after 10 failures (fake clock).- A quiet day (no
only_ifhit) spends zero model tokens (test). - Static prompt stays < 150 tokens; each room line and
--helpstays inside its budget.
Open questions (to record as OQ-n)
- Subscription syntax:
type@senderand#topicas proposed, or something simpler? - Private (direct) messages between members: excluded in v1; add only if needed.
- Should a standing room accumulate across routine runs, or start empty each run?
- Should an untargeted human message ever wake the lead by default? Proposed: no (passive); use
@lead. - Optional A2A/MCP adapter for rooms: when, and as which extra.
- Per-room rate limits when many members post at once.
Non-goals
- Open-network agents, social-network style channels, or cross-organisation agents.
- Any resident daemon, broker, or HTTP server in core.
- Letting a model decide membership, wake rules, budgets, sinks, or when a room is finished.
- Financial or other advice: example summaries are news summaries with sources, not forecasts.
north star: not applicable to this planning issue; the room lane is measured separately in phase 6 and must leave the single-agent Polyglot number unchanged.
Generated by Claude Code
- Dominant language
- Python
- Stars
- 3
- Forks
- 1
- Avg merge
- 1h 10m
- Merged PRs (30d)
- 175
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from igormcsouza/tether
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
igormcsouza/tether#428 ·
Maintainers usually reply within 1 day
-
landlock: jailed exec of bash refused on GitHub ubuntu-26.04 runner with Python 3.12 (3.13 passes)Openknown-issue
Difficulty 4/5 1-2 days Newbie friendliness 48/100
igormcsouza/tether#424 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
igormcsouza/tether#412 · 1 comment ·
Maintainers usually reply within 1 day
-
feat(api): tether serve, an optional local HTTP + SSE API for external UIs (no UI in this repo)Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
igormcsouza/tether#387 ·
Maintainers usually reply within 1 day
-
enhancement help wanted
Difficulty 5/5 Over a week Newbie friendliness 18/100
igormcsouza/tether#385 ·
Maintainers usually reply within 1 day
All issues in igormcsouza/tether
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
available bug good first issue tooling
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Nixitov/Riptide-Native#816 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
SpikeInterface/spikeinterface#5008 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
teng-lin/notebooklm-py#2593 ·
Maintainers usually reply within 1 day
-
claimed-by:collie role:small-fix status:running
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Beovulfo/herd-sdlc#325 · 1 comment ·
Maintainers usually reply within 1 day