fix(agent): harden @mention scope and simplify must_use hints

Tighten per-turn @MCP/@Skill/@tag handling after review: enforce agent
MCP/Skill whitelist, ignore mentions when selection mode is none, tag-scope
grep_chunks, and simplified English must_use lines without tool dumps.
Skip persisting scope envelopes to history rendered_content.
This commit is contained in:
wizardchen
2026-06-29 16:54:08 +08:00
committed by lyingbug
parent 049f85139d
commit b86efe3f92
14 changed files with 442 additions and 104 deletions
+5 -1
View File
@@ -247,7 +247,11 @@ func (h *Handler) parseQARequest(c *gin.Context, logPrefix string) (*qaRequestCo
// had memory enabled in practice, keep that behaviour.
enableMemory := h.resolveEnableMemory(ctx, request.EnableMemory)
tagScopes := tagScopesFromMentionedItems(request.MentionedItems)
tagScopes := mergeTagScopesFromRequestIDs(
tagScopesFromMentionedItems(request.MentionedItems),
dedupRequestStrings(request.TagIDs),
secutils.SanitizeForLogArray(kbIDs),
)
tagIDs := dedupRequestStrings(append(request.TagIDs, mentionedIDsByType(request.MentionedItems, "tag")...))
mcpServiceIDs := dedupRequestStrings(append(request.MCPServiceIDs, mentionedIDsByType(request.MentionedItems, "mcp")...))
skillNames := dedupRequestStrings(append(request.SkillNames, mentionedIDsByType(request.MentionedItems, "skill")...))