You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: _validate_log_path silently drops subdirectory components in logs.py #2194
In autobot-backend/api/logs.py, the _validate_log_path function introduced in PR #2101 (#1721) uses Path(file_path).name which extracts only the final filename component, silently dropping any subdirectory:
For example, Path("/opt/autobot/logs/subdir/app.log").name returns "app.log", so the validated path becomes LOG_DIR/app.log instead of LOG_DIR/subdir/app.log.
Impact
Requests for nested log files silently resolve to wrong paths (404 or wrong file)
Behavioral regression from the previous implementation which preserved subdirectory structure
Severity: medium — current log storage may be flat, but the code is objectively wrong
Fix
Pass the filename directly rather than going through LOG_DIR / filename and stripping back:
Activity
fix(logs): preserve subdirectory components in _validate_log_path (#2194
fix(logs): preserve subdirectory in _validate_log_path (#2194)
fix(logs): preserve subdirectory in _validate_log_path (#2194)
github-actions commentedon Mar 24, 2026
PR #2285 (merged to
Dev_new_gui) references this issue with a close keyword.If this issue is fully resolved, close it manually. If work remains, no action is needed.
mrveiss commentedon Mar 24, 2026
Fixed in PR #2285 — subdirectory preserved in _validate_log_path.