Tool结果大小控制器

v1.0.0

自动判断工具结果大小,超阈值时gzip压缩落盘并返回文件元数据,保护对话上下文窗口免受大数据干扰

0· 78·1 current·1 all-time
MIT-0
Download zip
LicenseMIT-0 · Free to use, modify, and redistribute. No attribution required.
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
The code and SKILL.md both implement spilling large tool results to disk, gzip compression, returning metadata, previewing the first 500 chars, and a cleanup routine. The requested capabilities match the stated purpose.
Instruction Scope
SKILL.md usage and API (maybe_spill, load_spilled_result, cleanup_old_results, decorator) matches the code. Minor discrepancy: SKILL.md lists RESULTS_DIR as `tmp/tool-results/` and examples/permissions refer to that path and a logs file, but the code actually writes to a per-user path: ~/.openclaw/workspace/tmp/tool-results. SKILL.md also mentions a logs file (`logs/tool-size.log`) that is not implemented in the code.
Install Mechanism
No install spec or external downloads; the skill is instruction+source only and uses only standard library modules (json, gzip, hashlib, pathlib, datetime). No elevated install risk detected.
Credentials
The skill requests no environment variables or credentials. It writes files under the user's home directory (RESULTS_DIR), which is proportional to its purpose but does require file system write/read permissions.
Persistence & Privilege
The skill does persist files to disk and deletes files older than MAX_AGE_DAYS. It is not always-enabled and does not modify other skills or system-wide configs. Because it stores potentially sensitive tool outputs on disk, consider access controls for the results directory.
Assessment
This skill appears to do what it says: compress and spill large tool results to disk and return metadata. Before installing, check these practical points: 1) Path and permissions — the code writes to ~/.openclaw/workspace/tmp/tool-results (not the relative tmp/tool-results shown in the docs); ensure the agent has explicit permission to read/write that directory and that its location is acceptable. 2) Data sensitivity — spilled files (and the 500‑char preview) can contain sensitive data; if that is a concern, change RESULTS_DIR to a secure location, raise the threshold, or shorten retention. 3) Retention/cleanup — cleanup deletes files older than MAX_AGE_DAYS; configure cron or run cleanup regularly. 4) Minor doc mismatch — logs referenced in SKILL.md are not implemented in code; adjust expectations. No network calls, no secret access, and no external installers were found.

Like a lobster shell, security has layers — review code before you run it.

claude-codevk97ffgkavzcxsdxc6qfemr83ax844k6flatestvk97ffgkavzcxsdxc6qfemr83ax844k6fresult-sizevk97ffgkavzcxsdxc6qfemr83ax844k6ftoolvk97ffgkavzcxsdxc6qfemr83ax844k6f

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

Comments