修复: read_file/grep 工具结果处理

BUG-260625-01 grep 单文件路径走 grep_one_file(旧 read_dir 报 os error 267 目录无效);BUG-260625-02 read_file search 模式渲染命中行 matches(旧取 content 显 0 行误判读取失败)。
This commit is contained in:
2026-06-25 00:27:02 +08:00
parent 24c3fa08f1
commit 047b3b91fa
3 changed files with 156 additions and 103 deletions

View File

@@ -85,6 +85,8 @@ export interface ToolResult {
body?: string
body_bytes?: number
elapsed_ms?: number
// read_file search 模式(BUG-260625-02):传 search 参数返命中行 matches[{line,content}] 非全文 content
search?: string
// grep 跨文件内容搜索结果字段(F-260621):
// - output_mode: content(默认)/ files_with_matches / count
// - matches: content 模式命中行 [{file,line,content,context?}]