feat: 移除所有工具结果截断,确保内容完整传给AI
删除TOOL_MAX_RESULT_SIZE配置表和formatDefaultToolResult截断; read_file移除2000行/100KB截断; read_multiple_files移除10000字符截断; list_directory移除2000条目上限; search_files移除10条匹配和50结果限制; run_command移除512KB输出截断; browser_extract移除15000字符截断; session_read移除50条消息限制; session_list移除20条限制; memory search移除8条限制; web_search移除10条结果限制; SearXNG HTML移除内容截断; 版本号升级至0.14.11; 实现工具三档执行模式(auto/confirm/disabled)
This commit is contained in:
@@ -286,7 +286,7 @@ export function serializeMemoryMd(entries: MemoryEntry[]): string {
|
||||
/**
|
||||
* 关键词搜索记忆
|
||||
*/
|
||||
export function searchMemory(entries: MemoryEntry[], query: string, limit = 8): MemorySearchResult[] {
|
||||
export function searchMemory(entries: MemoryEntry[], query: string, limit = 0): MemorySearchResult[] {
|
||||
if (!query || entries.length === 0) return [];
|
||||
|
||||
const queryLower = query.toLowerCase();
|
||||
@@ -331,7 +331,7 @@ export function searchMemory(entries: MemoryEntry[], query: string, limit = 8):
|
||||
}
|
||||
}
|
||||
|
||||
return merged.slice(0, limit);
|
||||
return limit > 0 ? merged.slice(0, limit) : merged;
|
||||
}
|
||||
|
||||
// ═══════════════════════════════════════════════════════════════
|
||||
@@ -437,7 +437,7 @@ export async function loadAllEntries(): Promise<MemoryEntry[]> {
|
||||
}
|
||||
|
||||
/** 搜索记忆(读取 MEMORY.md → 解析 → 搜索) */
|
||||
export async function search(query: string, limit = 8): Promise<MemorySearchResult[]> {
|
||||
export async function search(query: string, limit = 0): Promise<MemorySearchResult[]> {
|
||||
try {
|
||||
const entries = await loadAllEntries();
|
||||
return searchMemory(entries, query, limit);
|
||||
|
||||
Reference in New Issue
Block a user