0ea3861b33
Tool call ids are used to name persisted large-result files. Treating that id as a raw path segment allowed traversal-like ids to resolve outside hermes-results even though the shell command quoted metacharacters. Convert ids to single filename stems, preserve normal ids, and add a short hash when normalization is needed so unsafe ids do not collide silently. Constraint: Avoid new dependencies and preserve existing tool-result paths for normal tool call ids Rejected: Quote only the path | shell quoting does not prevent ../ path traversal Confidence: high Scope-risk: narrow Reversibility: clean Tested: source /Users/peter/hermes-agent/venv/bin/activate && pytest tests/tools/test_tool_result_storage.py -q Tested: source /Users/peter/hermes-agent/venv/bin/activate && python -m compileall tools/tool_result_storage.py tests/tools/test_tool_result_storage.py Tested: git diff --check