Repository navigation
refactor(tools): 精简高频命令与文件工具返回载荷中的冗余字段 - #269
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更说明
精简
exec_command/session_observe/session_act、search_text、read_file等高频工具返回载荷中的冗余零值与常量字段,降低日常工具调用的上下文 Token 消耗:internal/tool/command):stdout_truncated/stderr_truncated及对应的*_output_bytes、*_total_bytes、*_dropped_bytes、*_omitted_bytes仅在该流发生截断/丢弃/省略时输出;stderr、timed_out: false、默认terminal: pipes省略,仅在有值/触发时返回;stdout_output_lines/stderr_output_lines及其底层计算,并同步补齐OutputSchema。search_text按需输出上下文(internal/tool/file/search.go、internal/wslfilehelper):rg、go_fallback与 WSLgo_wsl三条路径:无前后上下文行时省略before、after、context_start_line、context_end_line,存在上下文行时按需输出;go_fallback末尾换行符拆分产生幽灵空行导致尾部上下文与rg/go_wsl不一致的问题。read_file硬编码常量encoding: utf-8(internal/tool/file):OutputSchema中移除encoding,非 UTF-8 仍保持返回ENCODING_UNSUPPORTED。验证
gofmt、go vet ./...、受影响全套 7 个测试包及 Linux 交叉编译(CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build ./...+wslfilehelper测试编译),全量跨平台测试交由本次 PR CI 验证。