docs: update references for delegate→team/teammate rename

- Update lane name, env var, channel references across all docs
- Mark delegate tool as removed in tools system docs
- Update routing tables and architecture diagrams
This commit is contained in:
viettranx committed 2026-03-18 11:05:23 +07:00
1 parent 48ebcf999b
commit 7b3ac84152
6 files changed
+35 -42

No files matched your search

+4 -4
View File
@@ -112,7 +112,7 @@ flowchart TD
| `internal/skills/` | SKILL.md loader (5-tier hierarchy) + BM25 search + hot-reload via fsnotify |
| `internal/channels/` | Channel manager + adapters: Telegram (forum topics, STT, bot commands), Feishu/Lark (streaming cards, media), Zalo OA, Zalo Personal, Discord, WhatsApp, Slack |
| `internal/mcp/` | MCP server bridge (stdio, SSE, streamable-HTTP transports) |
| `internal/scheduler/` | Lane-based concurrency control (main, subagent, cron, delegate lanes) with per-session serialization |
| `internal/scheduler/` | Lane-based concurrency control (main, subagent, cron, team lanes) with per-session serialization |
| `internal/memory/` | Memory system (pgvector hybrid search) |
| `internal/permissions/` | RBAC policy engine (admin, operator, viewer roles) |
| `internal/store/pg/pairing.go` | DM/device pairing service (8-character codes, database-backed) |
@@ -276,7 +276,7 @@ flowchart TD
S1[Subagent executions]
end
subgraph Del["Lane: delegate (concurrency 100)"]
subgraph Del["Lane: team (concurrency 100)"]
D1[Delegation executions]
end
@@ -303,7 +303,7 @@ flowchart TD
|------|:-----------:|-------------|---------|
| `main` | 30 | `GOCLAW_LANE_MAIN` | Primary user chat sessions |
| `subagent` | 50 | `GOCLAW_LANE_SUBAGENT` | Spawned subagents |
| `delegate` | 100 | `GOCLAW_LANE_DELEGATE` | Agent delegation executions |
| `team` | 100 | `GOCLAW_LANE_TEAM` | Agent team/delegation executions |
| `cron` | 30 | `GOCLAW_LANE_CRON` | Scheduled cron jobs |
### Session Queue Concurrency
@@ -392,7 +392,7 @@ flowchart TD
| `cmd/gateway.go` | Gateway startup orchestrator (`runGateway()`) |
| `cmd/gateway_managed.go` | Database wiring (`wireManagedExtras()`, `wireManagedHTTP()`) |
| `cmd/gateway_callbacks.go` | Shared callbacks (user seeding, context file loading) |
| `cmd/gateway_consumer.go` | Inbound message consumer (subagent, delegate, teammate routing) |
| `cmd/gateway_consumer.go` | Inbound message consumer (subagent, teammate routing) |
| `cmd/gateway_providers.go` | Provider registration (config-based + DB-based) |
| `cmd/gateway_methods.go` | RPC method registration |
| `internal/config/config.go` | Config struct definitions |
+6 -6
View File
@@ -112,9 +112,7 @@ Context keys ensure each tool call receives the correct per-call values without
### Delegation (group: `delegation`)
| Tool | Description |
|------|-------------|
| `delegate` | Delegate task to another agent (actions: delegate, cancel, list, history) |
> The `delegate` tool has been removed. Delegation is now handled via agent teams using `team_tasks` and `team_message`.
### Teams (group: `teams`)
@@ -368,7 +366,7 @@ flowchart TD
| `knowledge` | `knowledge_graph_search`, `skill_search` |
| `automation` | `cron`, `datetime` |
| `messaging` | `message`, `create_forum_topic` |
| `delegation` | `delegate` |
| `delegation` | ~~`delegate`~~ (removed) |
| `teams` | `team_tasks`, `team_message` |
| `media_gen` | `create_image`, `create_audio`, `create_video`, `tts` |
| `media_read` | `read_image`, `read_audio`, `read_document`, `read_video` |
@@ -437,11 +435,13 @@ Results are announced back to the parent agent via the message bus, optionally b
## 7. Delegation System
> **Note:** The `delegate` tool has been removed. The `DelegateManager` described below is deprecated/removed. Delegation is now handled via agent teams: leads create tasks on the shared board (`team_tasks`) and spawn member agents explicitly. See [11-agent-teams.md](11-agent-teams.md) for the current model.
Delegation allows named agents to delegate tasks to other fully independent agents (each with its own identity, tools, provider, model, and context files). Unlike subagents (anonymous clones), delegation crosses agent boundaries via explicit permission links.
### DelegateManager
### DelegateManager (Removed)
The subagent system in `internal/tools/subagent_spawn_tool.go` orchestrates all delegation operations:
The `delegate` tool and its `DelegateManager` in `internal/tools/subagent_spawn_tool.go` have been removed. Previously supported actions:
| Action | Mode | Behavior |
|--------|------|----------|
+2 -2
View File
@@ -64,8 +64,8 @@ The consumer routes system messages based on sender ID prefixes:
| Prefix | Route | Scheduler Lane |
|--------|-------|:-:|
| `subagent:` | Parent session queue | subagent |
| `delegate:` | Parent agent's original session | delegate |
| `teammate:` | Target agent session | delegate |
| `delegate:` | Parent agent's original session (legacy session key format) | team |
| `teammate:` | Target agent session | team |
---
+2 -2
View File
@@ -29,7 +29,7 @@ flowchart TD
S3["..."]
end
subgraph "Lane: delegate (concurrency = 100)"
subgraph "Lane: team (concurrency = 100)"
D1["Delegation 1"]
D2["Delegation 2"]
D3["..."]
@@ -53,7 +53,7 @@ flowchart TD
|------|:-----------:|-------------|---------|
| `main` | 30 | `GOCLAW_LANE_MAIN` | Primary user chat sessions |
| `subagent` | 50 | `GOCLAW_LANE_SUBAGENT` | Sub-agents spawned by the main agent |
| `delegate` | 100 | `GOCLAW_LANE_DELEGATE` | Agent delegation executions |
| `team` | 100 | `GOCLAW_LANE_TEAM` | Agent team/delegation executions |
| `cron` | 30 | `GOCLAW_LANE_CRON` | Scheduled cron jobs (per-session serialization prevents same-job races) |
`GetOrCreate()` allows creating new lanes on demand with custom concurrency. All lane concurrency values are configurable via environment variables.
+12 -21
View File
@@ -232,16 +232,7 @@ The board displays these snapshots in a visual timeline, allowing users to revie
### Delegate Agent Restrictions
Delegate agents (members executing delegated work) have restrictions to prevent lifecycle corruption:
- **Cannot complete directly**: Results are auto-completed when delegation finishes
- Error: `"delegate agents cannot complete team tasks directly — results are auto-completed when delegation finishes"`
- **Cannot cancel tasks**: Only the lead can cancel
- Error: `"delegate agents cannot cancel team tasks directly"`
- **Cannot approve/reject**: Only lead and dashboard users can approve/reject
- Error: `"delegate agents cannot reject team tasks"` (for reject)
This ensures task state transitions are controlled and audit-trail integrity is maintained.
Guards that previously prevented delegate agents from directly completing, cancelling, or approving/rejecting tasks are currently commented out (reserved for a future reviewer workflow). At this time, these restrictions are not enforced at runtime. A future implementation may re-enable them when a structured reviewer/approval flow is introduced.
### Assignee is Mandatory
@@ -264,7 +255,7 @@ This is safe because the claim is atomic — only one agent can succeed.
### User & Channel Scoping
- **System/delegate channels**: See all tasks for the team
- **System/teammate channels**: See all tasks for the team
- **Regular user channels**: Filter to tasks they triggered (filtered by user ID)
- **Scope discovery**: `teams.scopes` lists all unique channel+chatID scopes across tasks
- **Known users**: `teams.known_users` lists distinct user IDs from team member sessions (UI user select)
@@ -318,7 +309,7 @@ When a team message is sent, it flows through the message bus with a `"teammate:
[Team message from {sender_key}]: {message text}
```
The receiving agent processes this as an inbound message, routed through the delegate scheduler lane. The response is published back to the originating channel so the user (and lead) can see it.
The receiving agent processes this as an inbound message, routed through the team scheduler lane. The response is published back to the originating channel so the user (and lead) can see it.
### Use Cases
@@ -388,7 +379,7 @@ flowchart TD
LEAD["Lead receives user request"] --> CREATE["1. Create task on board<br/>team_tasks action=create<br/>→ returns task_id"]
CREATE --> SPAWN["2. Delegate to member<br/>spawn agent=member,<br/>team_task_id=task_id"]
SPAWN --> INJECT["Inject team workspace context<br/>WithToolTeamID<br/>WithToolTeamWorkspace<br/>WithTeamTaskID"]
INJECT --> LANE["Scheduled through<br/>delegate lane"]
INJECT --> LANE["Scheduled through<br/>team lane"]
LANE --> MEMBER["Member agent executes<br/>in isolated session<br/>with workspace access"]
MEMBER --> COMPLETE["3. Task auto-completed<br/>with delegation result"]
COMPLETE --> DISPATCH["Files auto-linked to task<br/>Comments/events recorded"]
@@ -427,7 +418,7 @@ When a delegation finishes (success or failure):
When the lead delegates to multiple members simultaneously:
- Each delegation runs independently in the delegate lane
- Each delegation runs independently in the team lane
- Intermediate completions accumulate their results (artifacts)
- When the **last** sibling delegation finishes, all accumulated results are collected
- A single combined announcement is delivered to the lead with all results
@@ -496,8 +487,8 @@ Team messages flow through the message bus with specific routing rules.
```mermaid
flowchart TD
subgraph "Inbound (Team Member Execution)"
LEAD_SPAWN["Lead: spawn agent=member,<br/>team_task_id=X"] --> BUS_IN["Message Bus<br/>SenderID: 'delegate:{id}'"]
BUS_IN --> CONSUMER["Consumer routes to<br/>delegate lane"]
LEAD_SPAWN["Lead: spawn agent=member,<br/>team_task_id=X"] --> BUS_IN["Message Bus<br/>SenderID: 'delegate:{id}' (legacy format)"]
BUS_IN --> CONSUMER["Consumer routes to<br/>team lane"]
CONSUMER --> MEMBER["Member agent runs<br/>in isolated session"]
end
@@ -506,7 +497,7 @@ flowchart TD
RESULT --> CHECK{"Last sibling?"}
CHECK -->|"No"| ACCUMULATE["Accumulate artifacts"]
CHECK -->|"Yes"| COLLECT["Collect all artifacts"]
COLLECT --> ANNOUNCE["Publish to parent session<br/>SenderID: 'delegate:{id}'"]
COLLECT --> ANNOUNCE["Publish to parent session<br/>SenderID: 'delegate:{id}' (legacy format)"]
ANNOUNCE --> LEAD_SESSION["Lead processes in<br/>original user session"]
end
@@ -521,8 +512,8 @@ flowchart TD
| Prefix | Source | Destination | Scheduler Lane |
|--------|--------|-------------|----------------|
| `delegate:` | Delegation completion | Parent agent's original session | delegate |
| `teammate:` | Team mailbox message | Target agent's session | delegate |
| `delegate:` | Delegation completion (legacy session key format) | Parent agent's original session | team |
| `teammate:` | Team mailbox message | Target agent's session | team |
### Session Context Preservation
@@ -556,7 +547,7 @@ Teams support fine-grained access control through team settings.
| `escalation_mode` | String | How to escalate stale tasks: "notify_lead", "fail_task" |
| `escalation_actions` | String list | Actions to take on escalation |
System channels (`delegate`, `system`) always pass access checks. Empty settings mean open access.
System channels (`teammate`, `system`) always pass access checks. Empty settings mean open access.
### Link-Level Settings
@@ -652,7 +643,7 @@ Teams emit events for real-time UI updates and observability.
| `internal/store/team_store.go` | TeamStore interface (~40 methods), data types: TeamData, TeamTaskData, TeamMessageData, TeamTaskCommentData, etc. |
| `internal/store/pg/teams.go` | PostgreSQL implementation: teams CRUD, members, tasks, messages, events, attachments |
| `cmd/gateway_managed.go` | Team tool wiring, cache invalidation subscription |
| `cmd/gateway_consumer.go` | Message routing for delegate/teammate prefixes, task dispatch to agents |
| `cmd/gateway_consumer.go` | Message routing for teammate/delegate (legacy) prefixes, task dispatch to agents |
---