feat(tools): add vault tool group to policy#982
Conversation
- Add ZAI/GLM context overflow patterns to error_classify.go - ThinkStage detects overflow, triggers emergency compaction + 1 retry - Wire ReserveTokensFloor config to pipeline budget calculation - Send user-friendly error on channel RunFailed events - Add sessions.compact WebSocket method for manual truncation
- Fix Accept header for JSON response negotiation (Shopee GETs) - Platform-prefix-aware pageID parsing (spo_ convID format) - 500-char message limit for Shopee DMs - Rune-safe truncation with slog.Warn on truncation Phase 3 (integration smoke) pending: requires real credentials.
Add "vault" group containing vault_search and vault_read tools. Include group:vault in messaging and coding profiles so agents using these profiles can search and read vault documents. Previously, vault tools were only in the goclaw composite group but not exposed to profile-restricted agents like Telegram bots.
Add MethodSessionsCompact to isWriteMethod to fix drift coverage test. Method was added in #958 but missing from permissions classification.
Use strings.Contains from stdlib instead of local contains helper to avoid redeclaration conflict with mcp_grant_revoke_test.go.
🔍 Code Review — feat(tools): add vault tool group to policy🎯 Tổng quanPR này thực chất là 5 commits gộp nhiều tính năng:
Scope: 24 files, ~800+ additions ✅ Điểm Tốt
|
| Severity | Count | Issues |
|---|---|---|
| 🔴 HIGH | 1 | PR squash quá nhiều tính năng độc lập |
| 🟡 MEDIUM | 2 | Duplicate overflow patterns; no concurrent guard for sessions.compact |
| 🟢 LOW | 1 | FormatAgentError hard-coded English |
💡 Recommendation
🔴 REQUEST CHANGES
Code quality tốt, từng tính năng implement đúng hướng. Nhưng PR quá lớn và squash nhiều features độc lập — nên split ra 3 PRs riêng để dễ review, dễ revert nếu có issue. Sau khi split, từng PR nhỏ sẽ dễ APPROVE.
Great work @nguyennguyenit! 🚀
|
Superseded by #984 - clean PR with only vault tool group changes |
Summary
vaulttool group containingvault_searchandvault_readgroup:vaultinmessagingandcodingprofilesProblem
Agents using
messagingprofile couldn't accessvault_search/vault_readtools, causing them to hallucinate file paths instead of searching vault first.Solution
Create dedicated
vaultgroup and add to relevant profiles. This also enables per-agent Tool Policy configuration viagroup:vault.Test plan
go build ./...passesgo test ./internal/tools/... -run Policypasses