← Back to PRs

#15684: fix(telegram): persist relative session transcript paths

by Jdo300 open 2026-02-13 18:43 View on GitHub →
stale size: XS
## Summary - fix session-state persistence to store `sessionFile` as a relative filename instead of an absolute path - normalize both normal and forked-session transcript path assignment via `path.basename(...)` - prevents Telegram inbound handler failures caused by strict sessions-dir validation rejecting absolute `sessionFile` values ## Verification - reproduced failure locally with logs showing `Session file path must be within sessions directory` on inbound Telegram messages - applied equivalent runtime patch and confirmed Telegram responses resumed - ported fix to source in `src/auto-reply/reply/session.ts` <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR adjusts session-state persistence in `src/auto-reply/reply/session.ts` so `sessionEntry.sessionFile` is stored as a relative filename (via `path.basename(...)`) for both newly created sessions and forked sessions. This aligns persisted state with `resolveSessionFilePath(...)` strict containment checks in `src/config/sessions/paths.ts`, avoiding failures when absolute paths would be rejected as “not within sessions directory.” <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk. - Change is narrowly scoped to session-file persistence and is consistent with the existing path-validation logic (which expects a within-sessions-dir relative path). Repository code confirms transcript paths are simple filenames, so using `path.basename` will not drop required subdirectory information. - src/auto-reply/reply/session.ts <sub>Last reviewed commit: 3bd7b82</sub> <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <!-- /greptile_comment -->

Most Similar PRs