You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: advanced/context-pruning.md
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -208,10 +208,22 @@ Pruning only acts on tool results. If long user messages or system prompt compon
208
208
209
209
---
210
210
211
+
## Pipeline Improvements
212
+
213
+
### Structured Compaction Summary
214
+
215
+
When context is compacted, the summary now preserves key identifiers — agent IDs, task IDs, and session keys — in a structured format. This ensures that agents can continue referencing their active tasks and sessions after compaction without losing critical tracking context.
216
+
217
+
### Tool Output Capping at Source
218
+
219
+
Tool output is now capped at the source before being added to context. Rather than waiting for the pruning pipeline to trim oversized results after the fact, GoClaw limits tool output size at ingestion time. This reduces unnecessary memory pressure and makes the pruning pipeline more predictable.
220
+
221
+
---
222
+
211
223
## What's Next
212
224
213
225
-[Sessions & History](/sessions-and-history) — session compaction, history limits
214
226
-[Memory System](/memory-system) — persistent memory across sessions
215
227
-[Configuration Reference](/config-reference) — full agent config reference
Copy file name to clipboardExpand all lines: advanced/knowledge-graph.md
+12-9Lines changed: 12 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ The graph is scoped per agent and per user — each agent builds its own graph f
17
17
18
18
After a conversation, GoClaw sends the text to an LLM with a structured extraction prompt. For long texts (over 12,000 characters), GoClaw splits the input into chunks, extracts from each, and merges results by deduplicating entities and relations. The LLM returns:
|`entity_id`| string | Start point for relationship traversal |
160
160
|`max_depth`| int | Traversal depth (default 2, max 3) |
161
161
162
162
### 3-Tier Search Fallback
163
163
164
164
The tool uses a 3-tier fallback strategy to ensure results are always returned:
165
165
166
-
1.**Traversal** (when `entity_id` provided) — BFS outgoing traversal up to `max_depth`, returns up to 20 results with path info and relation types
166
+
1.**Traversal** (when `entity_id` provided) — Bidirectional multi-hop traversal up to `max_depth`, returns up to 20 results with path info and relation types
167
167
2.**Direct connections** (fallback if traversal returns nothing) — Bidirectional 1-hop relations, capped at 10
168
168
3.**Text search** (fallback if no connections) — Full-text search on entity names/descriptions, returns up to 10 results with their relations (5 per entity)
169
169
@@ -181,7 +181,7 @@ query: "John"
181
181
query: "*"
182
182
```
183
183
184
-
**Traverse relationships** — Start from an entity and follow outgoing connections:
184
+
**Traverse relationships** — Start from an entity and follow connections in both directions:
185
185
```
186
186
query: "*"
187
187
entity_id: "project-alpha"
@@ -266,12 +266,15 @@ Relations are directional: `source --relation_type--> target`. Deleting an entit
266
266
| Type | Examples |
267
267
|------|----------|
268
268
|`person`| Team members, contacts, stakeholders |
269
-
|`project`| Products, initiatives, codebases |
269
+
|`organization`| Companies, teams, departments |
270
+
|`project`| Initiatives, codebases, programs |
271
+
|`product`| Software products, services, features |
272
+
|`technology`| Languages, frameworks, platforms |
270
273
|`task`| Action items, tickets, assignments |
271
274
|`event`| Meetings, deadlines, milestones |
272
-
|`concept`| Technologies, methodologies, ideas |
275
+
|`document`| Reports, specs, wikis, runbooks |
276
+
|`concept`| Methodologies, ideas, principles |
273
277
|`location`| Offices, cities, regions |
274
-
|`organization`| Companies, teams, departments |
275
278
276
279
---
277
280
@@ -378,4 +381,4 @@ An agent can then answer questions like *"Who is working on Project Alpha?"* by
Copy file name to clipboardExpand all lines: advanced/mcp-integration.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ graph LR
24
24
Registry --> Agent
25
25
```
26
26
27
-
GoClaw runs a health-check loop every 30 seconds and reconnects with exponential backoff (initial delay 2 s, up to 10 attempts, capped at 60 s between retries) if a server goes down.
27
+
GoClaw runs a health-check loop every 30 seconds. A server is only marked disconnected after **3 consecutive ping failures** — transient network blips do not trigger a reconnect. When a server does go down, GoClaw reconnects with exponential backoff (initial delay 2 s, up to 10 attempts, capped at 60 s between retries).
28
28
29
29
## Registering an MCP Server
30
30
@@ -103,13 +103,13 @@ If no prefix is set and a name collision is detected, GoClaw logs a warning (`mc
103
103
104
104
## Search Mode (large tool sets)
105
105
106
-
When the total number of MCP tools across all servers exceeds **40**, GoClaw automatically enters **search mode**: tools are no longer registered inline in the tool registry. Instead, only the built-in `mcp_tool_search` tool is exposed. The agent uses `mcp_tool_search` to find and activate specific MCP tools on demand.
106
+
When the total number of MCP tools across all servers exceeds **40**, GoClaw automatically enters **hybrid mode**: the first 40 tools remain registered inline in the tool registry, while the remainder are deferred to search mode. In hybrid mode, the built-in `mcp_tool_search` tool is also exposed so the agent can find and activate the deferred tools on demand.
107
107
108
108
This keeps the tool list manageable when connecting many MCP servers. There is no configuration required — the switch is automatic.
109
109
110
110
### Lazy activation
111
111
112
-
In search mode, if an agent calls a deferred MCP tool directly by name (without searching first), GoClaw **auto-activates** it. The tool is resolved from the MCP server, registered on the fly, and executed — no extra search step needed. This enables compatibility with agents that already know the tool name from prior context.
112
+
In hybrid mode, if an agent calls a deferred MCP tool directly by name (without searching first), GoClaw **auto-activates** it. The tool is resolved from the MCP server, registered on the fly, and executed — no extra search step needed. This enables compatibility with agents that already know the tool name from prior context.
113
113
114
114
## Per-Agent Access Grants
115
115
@@ -297,4 +297,4 @@ Requires admin role. The credentials are encrypted at rest using `GOCLAW_ENCRYPT
297
297
- [Custom Tools](../advanced/custom-tools.md) — build shell-backed tools without an MCP server
298
298
- [Skills](../advanced/skills.md) — inject reusable knowledge into agent system prompts
Copy file name to clipboardExpand all lines: channels/discord.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,15 +76,15 @@ In servers (channels), the bot requires being mentioned by default (`require_men
76
76
77
77
### Typing Indicator
78
78
79
-
While the agent processes, a typing indicator is shown (9-second keepalive).
79
+
While the agent processes, a typing indicator is shown (9-second keepalive). The typing indicator stops automatically after successful message delivery.
80
80
81
81
### Thread Support
82
82
83
83
The bot automatically detects and responds in Discord threads. Responses stay in the same thread.
84
84
85
85
### Media from Replied-to Messages
86
86
87
-
When a user replies to a message that contains media attachments, GoClaw extracts those attachments and includes them in the inbound message context. This lets the agent see and process media even when it was originally shared in a previous turn.
87
+
When a user replies to a message that contains media attachments, GoClaw extracts those attachments and includes them in the inbound message context. This lets the agent see and process media even when it was originally shared in a previous turn. Attachment source URLs are preserved in media tags, so agents can reference the original Discord CDN URL.
88
88
89
89
### Group Media History
90
90
@@ -135,4 +135,4 @@ Per-guild/channel overrides are not yet supported in the Discord channel impleme
135
135
-[Larksuite](/channel-feishu) — Larksuite integration with streaming cards
Copy file name to clipboardExpand all lines: core-concepts/agents-explained.md
+36-1Lines changed: 36 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -169,10 +169,45 @@ After each conversation run, GoClaw evaluates whether to compact session history
169
169
170
170
Predefined agents have built-in protection against social engineering. If a user tries to convince the agent to ignore its SOUL.md or act outside its defined identity, the agent is designed to resist. Shared identity files are injected into the system prompt at a level that takes precedence over user instructions.
171
171
172
+
## Subagent Enhancements
173
+
174
+
When an agent spawns subagents via the `spawn` tool, the following capabilities apply:
175
+
176
+
### Per-Edition Rate Limiting
177
+
178
+
The `Edition` struct enforces two tenant-scoped limits on subagent usage:
179
+
180
+
| Field | Description |
181
+
|-------|-------------|
182
+
|`MaxSubagentConcurrent`| Max number of subagents running in parallel per tenant |
183
+
|`MaxSubagentDepth`| Max nesting depth — prevents unbounded delegation chains |
184
+
185
+
These are set per edition and enforced at spawn time.
186
+
187
+
### Token Cost Tracking
188
+
189
+
Each subagent accumulates per-call input and output token counts. Totals are persisted in the database and included in announce messages, giving the parent agent full visibility into delegation cost.
190
+
191
+
### WaitAll Orchestration
192
+
193
+
`spawn(action=wait, timeout=N)` blocks the parent until all previously spawned children complete. This enables fan-out/fan-in patterns without polling.
194
+
195
+
### Auto-Retry with Backoff
196
+
197
+
Configurable `MaxRetries` (default `2`) with linear backoff handles transient LLM failures automatically. The parent is only notified on permanent failure after all retries are exhausted.
198
+
199
+
### SubagentDenyAlways
200
+
201
+
Subagents cannot spawn nested subagents — the `team_tasks` tool is blocked in subagent context. All delegation must originate from a top-level agent.
202
+
203
+
### Producer-Consumer Announce Queue
204
+
205
+
Staggered subagent results are queued and merged into a single LLM run announcement on the parent side. This reduces unnecessary parent wake-ups when multiple subagents finish at different times.
206
+
172
207
## What's Next
173
208
174
209
-[Sessions and History](/sessions-and-history) — How conversations persist
175
210
-[Tools Overview](/tools-overview) — What tools agents can use
176
211
-[Memory System](/memory-system) — Long-term memory and search
Copy file name to clipboardExpand all lines: core-concepts/tools-overview.md
+20-1Lines changed: 20 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -184,6 +184,25 @@ Admins can disable specific groups per agent:
184
184
185
185
The `tools.exec_approval` setting adds an additional approval layer (`full`, `light`, or `none`).
186
186
187
+
## spawn — Subagent Orchestration
188
+
189
+
The `spawn` tool (part of `group:sessions`) creates and runs subagents. Key capabilities:
190
+
191
+
| Capability | Detail |
192
+
|-----------|--------|
193
+
|**WaitAll**|`spawn(action=wait, timeout=N)` blocks the parent until all previously spawned children complete. Useful for fan-out/fan-in patterns. |
194
+
|**Auto-retry**| Configurable `MaxRetries` (default `2`) with linear backoff on LLM failures. Transient errors are retried automatically. |
195
+
|**Token tracking**| Each subagent accumulates per-call input/output token counts. Totals are included in announce messages so the parent can account for cost. |
196
+
|**SubagentDenyAlways**| Subagents cannot spawn nested subagents — the `team_tasks` tool is blocked in subagent context. Prevents unbounded delegation chains. |
197
+
|**Producer-consumer announce queue**| Staggered subagent results are queued and merged into a single LLM run announcement on the parent side, reducing unnecessary wake-ups. |
198
+
199
+
```jsonc
200
+
// Example: fan-out then wait
201
+
spawn(action=start, prompt="Summarize part A")
202
+
spawn(action=start, prompt="Summarize part B")
203
+
spawn(action=wait, timeout=120) // blocks until both finish
204
+
```
205
+
187
206
## Session Tool Security
188
207
189
208
Session tools (`sessions_list`, `sessions_history`, `sessions_send`) are hardened with fail-closed validation:
@@ -234,4 +253,4 @@ All parameters are optional — defaults apply when not configured.
234
253
-[Multi-Tenancy](/multi-tenancy) — Per-user tool access and isolation
235
254
-[Custom Tools](/custom-tools) — Build your own tools
Copy file name to clipboardExpand all lines: deployment/upgrading.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ A GoClaw upgrade has two parts:
9
9
1.**SQL migrations** — schema changes applied by `golang-migrate` (idempotent, versioned)
10
10
2.**Data hooks** — optional Go-based data transformations that run after schema migrations (e.g. backfilling a new column)
11
11
12
-
The `./goclaw upgrade` command handles both in the correct order. It is safe to run multiple times — it is fully idempotent. The current required schema version is **33**.
12
+
The `./goclaw upgrade` command handles both in the correct order. It is safe to run multiple times — it is fully idempotent. The current required schema version is **34**.
13
13
14
14
```mermaid
15
15
graph LR
@@ -226,6 +226,7 @@ These five migrations are auto-applied on startup when upgrading to v2.x. No man
226
226
| 031 | Adds `tsv tsvector` generated column + GIN index to `kg_entities` for full-text search; creates `kg_dedup_candidates` table for entity deduplication review |
227
227
| 032 | Creates `secure_cli_user_credentials` for per-user CLI credential injection; adds `contact_type` column to `channel_contacts`|
228
228
| 033 | Cron payload columns | Promotes `stateless`, `deliver`, `deliver_channel`, `deliver_to`, `wake_heartbeat` from `payload` JSONB to dedicated columns on `cron_jobs`|
0 commit comments