feat(tools): optimize tool system pipeline#181
feat(tools): optimize tool system pipeline#181520wheat wants to merge 6 commits into1024XEngineer:mainfrom
Conversation
There was a problem hiding this comment.
Verified findings from this review:
- High – build regression (duplicate symbols)
internal/tui/model.go:2125(also2316,2330,2428,2452,2456,2464,3301,3333,3381)
go test currently fails because functions in model.go are redeclared while also existing in extracted component files (component_conversation.go, component_footer.go, component_status_scroll.go).
- High – test compile regression
internal/agent/runner_test.go/internal/agent/runner_complex_test.go:89(also193,252,348,393)
runner_complex_test.go still references generousTokenQuota, but that symbol is no longer defined after this refactor. go test ./internal/agent fails with undefined: generousTokenQuota.
- High – path traversal risk
internal/storage/session_files.go:75
SessionPath() joins raw sessionID directly into a filesystem path without validating separators or traversal (..). This allows path escape if a crafted session id is loaded/saved.
- Medium – sensitive data exposure risk
internal/storage/prompt_history.go:106,internal/storage/audit.go:85,internal/agent/tool_execution.go:89-92
Raw prompts and tool error strings are persisted, and files are created with mode 0644. This can leak sensitive content on multi-user systems; prefer stricter permissions (for example 0600) and avoid persisting full error payloads by default.
- Medium – unrelated artifact committed
generate_random.go:1,generate_random.py:1
These files appear unrelated to the tool-system/app refactor and include hardcoded personal desktop paths. They should be removed from this PR.
Validation performed:
go test ./internal/app ./internal/agent ./internal/tools ./internal/tui(fails with the compile issues above).
generate_random.go
Outdated
| rand.Seed(time.Now().UnixNano()) | ||
|
|
||
| // 桌面路径 | ||
| desktopPath := "C:\\Users\\wheat\\Desktop\\随机数.txt" |
There was a problem hiding this comment.
This file appears unrelated to the PR scope (tool pipeline/app refactor) and contains a hardcoded personal desktop path. Please remove this artifact (and its Python counterpart) from the PR.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
摘要
Runner -> Registry -> Tool.Run升级为Runner -> Executor -> decode/permission/execute/normalize -> Tool.Run原因
测试
upstream/refactorfeat/tool-system-pr1