feat(agent): add tool result persistence trimming for large outputs

Introduce display_type-based output stripping for SSE/DB storage and
add knowledge_chunks_list display type for list_knowledge_chunks.
This commit is contained in:
wizardchen
2026-06-16 00:49:38 +08:00
committed by lyingbug
parent 16f2a46465
commit efe8b6f41d
6 changed files with 360 additions and 7 deletions
@@ -269,6 +269,7 @@ func (t *ListKnowledgeChunksTool) Execute(ctx context.Context, args json.RawMess
Success: true,
Output: output,
Data: map[string]interface{}{
"display_type": "knowledge_chunks_list",
"knowledge_id": knowledgeID,
"knowledge_title": knowledgeTitle,
"total_chunks": totalChunks,
@@ -325,6 +326,7 @@ func (t *ListKnowledgeChunksTool) executeByChunkID(ctx context.Context, chunkID
normalizeFAQChunkDataMap(formattedChunks[0], chunk)
data := map[string]interface{}{
"display_type": "knowledge_chunks_list",
"knowledge_id": chunk.KnowledgeID,
"knowledge_title": knowledgeTitle,
"total_chunks": int64(1),