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: channels/telegram.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -291,6 +291,16 @@ Each Telegram instance maintains an isolated HTTP transport — no shared connec
291
291
}
292
292
```
293
293
294
+
## Group-to-Supergroup Migration
295
+
296
+
When a Telegram group is upgraded to a supergroup, the chat ID changes. GoClaw handles this automatically:
297
+
298
+
-**Inbound detection** — When a `MigrateToChatID` message arrives, GoClaw updates all DB references (paired_devices, sessions, channel_contacts) atomically and invalidates in-memory caches
299
+
-**Send-path retry** — If a send fails because the group was migrated, GoClaw detects the new chat ID from the Telegram API error, updates DB, and retries the send automatically
300
+
-**Idempotent** — Safe to trigger multiple times; duplicate migrations are no-ops
301
+
302
+
No configuration needed. Check logs for `telegram: migrating group chat` entries if troubleshooting.
303
+
294
304
## Troubleshooting
295
305
296
306
| Issue | Solution |
@@ -308,4 +318,4 @@ Each Telegram instance maintains an isolated HTTP transport — no shared connec
Copy file name to clipboardExpand all lines: core-concepts/tools-overview.md
+15-1Lines changed: 15 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,6 +95,10 @@ GoClaw registers aliases so agents can reference tools by alternative names. Thi
95
95
96
96
Aliases appear as one-line descriptions in the system prompt. They are not separate tools — calling an alias invokes the underlying tool.
97
97
98
+
### Deterministic Ordering
99
+
100
+
All tool names, aliases, and MCP tool descriptions are sorted lexicographically before being included in the system prompt. This ensures identical prompt prefixes across requests, maximizing LLM prompt cache hit rates (Anthropic and OpenAI cache by exact prefix match).
101
+
98
102
## Policy Engine
99
103
100
104
Beyond profiles, a 7-step policy engine gives fine-grained control:
@@ -184,6 +188,16 @@ Admins can disable specific groups per agent:
184
188
}
185
189
```
186
190
191
+
### Hardened Exemption Matching
192
+
193
+
When a shell command matches a deny pattern, GoClaw checks path exemptions (e.g., `.goclaw/skills-store/`). The exemption logic is strict:
194
+
195
+
-**All-or-nothing** — Every field in the command that triggers the deny pattern must be individually covered by an exemption. A single unexempted field blocks the entire command
196
+
-**Path traversal blocked** — Fields containing `..` are never exempt, preventing exemption escape via `../../etc/passwd`
197
+
-**Quote stripping** — Surrounding quotes (`"`, `'`) are stripped before matching, since LLMs often quote paths
198
+
199
+
This prevents pipe/comment bypass attacks like `cat /app/data/skills-store/tool.py | cat /app/data/secret` — the second field matches deny but has no exemption, so the entire command is blocked.
200
+
187
201
The `tools.exec_approval` setting adds an additional approval layer (`full`, `light`, or `none`).
188
202
189
203
## spawn — Subagent Orchestration
@@ -255,4 +269,4 @@ All parameters are optional — defaults apply when not configured.
255
269
-[Multi-Tenancy](/multi-tenancy) — Per-user tool access and isolation
256
270
-[Custom Tools](/custom-tools) — Build your own tools
Copy file name to clipboardExpand all lines: vi/channels/telegram.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -295,6 +295,16 @@ Mỗi Telegram instance duy trì HTTP transport riêng biệt — không share c
295
295
}
296
296
```
297
297
298
+
## Chuyển đổi Group sang Supergroup
299
+
300
+
Khi một Telegram group được nâng cấp thành supergroup, chat ID sẽ thay đổi. GoClaw xử lý tự động:
301
+
302
+
-**Phát hiện tin nhắn đến** — Khi nhận được message `MigrateToChatID`, GoClaw cập nhật tất cả tham chiếu DB (paired_devices, sessions, channel_contacts) atomically và xóa cache trong bộ nhớ
303
+
-**Retry khi gửi** — Nếu gửi tin thất bại do group đã migrate, GoClaw phát hiện chat ID mới từ Telegram API error, cập nhật DB và tự động gửi lại
304
+
-**Idempotent** — An toàn khi kích hoạt nhiều lần; các migration trùng lặp là no-op
305
+
306
+
Không cần cấu hình. Kiểm tra log với `telegram: migrating group chat` nếu cần troubleshoot.
307
+
298
308
## Xử lý sự cố
299
309
300
310
| Vấn đề | Giải pháp |
@@ -312,4 +322,4 @@ Mỗi Telegram instance duy trì HTTP transport riêng biệt — không share c
Copy file name to clipboardExpand all lines: vi/core-concepts/tools-overview.md
+15-1Lines changed: 15 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,6 +97,10 @@ GoClaw đăng ký alias để agent có thể tham chiếu tool bằng tên khá
97
97
98
98
Alias xuất hiện dưới dạng mô tả một dòng trong system prompt. Chúng không phải tool riêng biệt — gọi alias sẽ kích hoạt tool gốc.
99
99
100
+
### Sắp xếp xác định (Deterministic Ordering)
101
+
102
+
Tất cả tên tool, alias và mô tả MCP tool được sắp xếp theo thứ tự chữ cái trước khi đưa vào system prompt. Điều này đảm bảo prompt prefix giống hệt nhau giữa các request, tối đa hóa tỷ lệ cache hit của LLM prompt (Anthropic và OpenAI cache theo exact prefix match).
103
+
100
104
## Policy Engine
101
105
102
106
Ngoài profile, policy engine 7 bước cho phép kiểm soát chi tiết:
@@ -186,6 +190,16 @@ Admin có thể tắt nhóm cụ thể theo từng agent:
186
190
}
187
191
```
188
192
193
+
### Kiểm tra Exemption nghiêm ngặt
194
+
195
+
Khi lệnh shell khớp deny pattern, GoClaw kiểm tra path exemption (ví dụ: `.goclaw/skills-store/`). Logic exemption rất chặt chẽ:
196
+
197
+
-**Tất cả hoặc không** — Mọi field trong lệnh khớp deny pattern đều phải được exemption riêng lẻ. Một field không được exempt sẽ chặn toàn bộ lệnh
198
+
-**Chặn path traversal** — Field chứa `..` không bao giờ được exempt, ngăn chặn escape qua `../../etc/passwd`
199
+
-**Loại bỏ dấu ngoặc** — Dấu ngoặc bao quanh (`"`, `'`) được loại trước khi so khớp, vì LLM thường đặt path trong ngoặc
200
+
201
+
Điều này ngăn chặn tấn công bypass qua pipe/comment như `cat /app/data/skills-store/tool.py | cat /app/data/secret` — field thứ hai khớp deny nhưng không có exemption, nên toàn bộ lệnh bị chặn.
202
+
189
203
Cài đặt `tools.exec_approval` thêm một lớp phê duyệt bổ sung (`full`, `light`, hoặc `none`).
190
204
191
205
## spawn — Điều phối Subagent
@@ -257,4 +271,4 @@ Tất cả tham số đều tùy chọn — giá trị mặc định áp dụng
257
271
-[Multi-Tenancy](/multi-tenancy) — Truy cập tool per-user và cách ly
258
272
-[Custom Tools](/custom-tools) — Xây dựng tool của riêng bạn
0 commit comments