mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-03 05:20:01 +00:00
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:
1 parent
48ebcf999b
commit
7b3ac84152
6 files changed
+35
-42
No files matched your search
@@ -45,7 +45,7 @@ A Go port of [OpenClaw](https://github.com/openclaw/openclaw) with enhanced secu
|
||||
| Prompt caching | — | — | — | ✅ Anthropic + OpenAI-compat |
|
||||
| Knowledge graph | — | — | — | ✅ LLM extraction + traversal |
|
||||
| Skill system | ✅ Embeddings/semantic | ✅ SKILL.md + TOML | ✅ Basic | ✅ BM25 + pgvector hybrid |
|
||||
| Lane-based scheduler | ✅ | Bounded concurrency | — | ✅ (main/subagent/delegate/cron + concurrent group runs) |
|
||||
| Lane-based scheduler | ✅ | Bounded concurrency | — | ✅ (main/subagent/team/cron + concurrent group runs) |
|
||||
| Messaging channels | 37+ | 15+ | 10+ | 7+ |
|
||||
| Companion apps | macOS, iOS, Android | Python SDK | — | Web dashboard |
|
||||
| Live Canvas / Voice | ✅ (A2UI + TTS/STT) | — | Voice transcription | TTS (4 providers) |
|
||||
@@ -74,10 +74,10 @@ graph TB
|
||||
direction TB
|
||||
WS["WebSocket RPC"] & REST["HTTP Server"] & CM["Channel Manager"]
|
||||
WS & REST & CM --> BUS["Message Bus"]
|
||||
BUS --> SCHED["Lane-based Scheduler<br/>main · subagent · delegate · cron"]
|
||||
BUS --> SCHED["Lane-based Scheduler<br/>main · subagent · team · cron"]
|
||||
SCHED --> ROUTER["Agent Router"]
|
||||
ROUTER --> LOOP["Agent Loop<br/>think → act → observe"]
|
||||
LOOP --> TOOLS["Tool Registry<br/>fs · exec · web · memory · delegate · team · mcp · custom"]
|
||||
LOOP --> TOOLS["Tool Registry<br/>fs · exec · web · memory · team · mcp · custom"]
|
||||
LOOP --> LLM["LLM Providers<br/>Anthropic (native + prompt caching) · OpenAI-compat (12+)"]
|
||||
end
|
||||
|
||||
@@ -97,6 +97,8 @@ GoClaw supports four orchestration patterns for agent collaboration, all managed
|
||||
|
||||
### Agent Delegation
|
||||
|
||||
> **Note:** The standalone `delegate` tool has been removed. Delegation is now managed through agent teams — leads create tasks on the shared board and spawn members explicitly. The patterns below describe the conceptual model; see [Agent Teams](#agent-teams) for current tooling.
|
||||
|
||||
Agent delegation enables named agents to delegate tasks to other agents — each running with its own identity, tools, LLM provider, and context files. Unlike subagents (anonymous clones of the parent), delegation targets are fully independent agents.
|
||||
|
||||
```mermaid
|
||||
@@ -241,7 +243,7 @@ flowchart TD
|
||||
- **Agent delegation** — Sync/async inter-agent task delegation with permission links, concurrency limits, and per-user restrictions
|
||||
- **Agent teams** — Shared task boards with dependencies, team mailbox, and coordinated multi-agent workflows
|
||||
- **Delegation history** — Queryable audit trail of all inter-agent delegations
|
||||
- **Concurrent execution** — Lane-based scheduler (main/subagent/delegate/cron), adaptive throttle for group chats
|
||||
- **Concurrent execution** — Lane-based scheduler (main/subagent/team/cron), adaptive throttle for group chats
|
||||
|
||||
### Tools & Integrations
|
||||
- **60+ built-in tools** — File system, shell exec, web search/fetch, memory, browser automation, TTS, and more
|
||||
@@ -555,7 +557,7 @@ When `GOCLAW_*_API_KEY` environment variables are set, the gateway automatically
|
||||
| ---------------------- | ---------------------------- | ------- |
|
||||
| `GOCLAW_LANE_MAIN` | Main lane concurrency | `30` |
|
||||
| `GOCLAW_LANE_SUBAGENT` | Subagent lane concurrency | `50` |
|
||||
| `GOCLAW_LANE_DELEGATE` | Delegation lane concurrency | `100` |
|
||||
| `GOCLAW_LANE_TEAM` | Team lane concurrency | `100` |
|
||||
| `GOCLAW_LANE_CRON` | Cron lane concurrency | `30` |
|
||||
|
||||
</details>
|
||||
@@ -794,7 +796,7 @@ This creates `.env` with `GOCLAW_ENCRYPTION_KEY` and `GOCLAW_GATEWAY_TOKEN` pre-
|
||||
| `tts` | — | Text-to-Speech synthesis |
|
||||
| `spawn` | — | Spawn a subagent |
|
||||
| `subagents` | sessions | Control running subagents |
|
||||
| `delegate` | orchestration | Delegate tasks to other agents (sync/async, cancel, list) |
|
||||
| ~~`delegate`~~ | orchestration | ~~Delegate tasks to other agents~~ (removed — use `team_tasks`) |
|
||||
| `team_tasks` | teams | Shared task board (list, create, claim, complete, search) |
|
||||
| `team_message` | teams | Team mailbox (send, broadcast, read) |
|
||||
| `sessions_list` | sessions | List active sessions |
|
||||
@@ -906,7 +908,7 @@ GOCLAW_OPENROUTER_API_KEY=sk-or-xxx go test -v ./tests/integration/ -timeout 120
|
||||
- **WebSocket RPC protocol (v3)** — Connect handshake, chat streaming, event push all tested with web dashboard and integration tests.
|
||||
- **Store layer (PostgreSQL)** — All PG stores (sessions, agents, providers, skills, cron, pairing, tracing, memory, teams) implemented and running.
|
||||
- **Browser automation** — Rod/CDP integration for headless Chrome, tested in production agent workflows.
|
||||
- **Lane-based scheduler** — Main/subagent/delegate/cron lane isolation with concurrent execution tested. Group chats support up to 3 concurrent agent runs per session with adaptive throttle and deferred session writes for history isolation.
|
||||
- **Lane-based scheduler** — Main/subagent/team/cron lane isolation with concurrent execution tested. Group chats support up to 3 concurrent agent runs per session with adaptive throttle and deferred session writes for history isolation.
|
||||
- **Security hardening** — Rate limiting, prompt injection detection, CORS, shell deny patterns, SSRF protection, credential scrubbing all implemented and verified.
|
||||
- **Web dashboard** — Channel management, agent management, pairing approval, traces & spans viewer, skills, MCP, cron, sessions, teams, and config pages all implemented and working.
|
||||
- **Prompt caching** — Anthropic (explicit `cache_control`), OpenAI/MiniMax/OpenRouter (automatic). Cache metrics tracked in trace spans and displayed in web dashboard.
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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 |
|
||||
|--------|------|----------|
|
||||
|
||||
@@ -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 |
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -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
@@ -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 |
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in new issue
Block a user