[Bug] /resume last and --continue find no session when the working directory differs only by letter case
Summary
listSessions filters sessions with a plain string comparison of the working directory. On Windows c:\work\proj and C:\Work\Proj are the same folder, but they do not match.
Steps to reproduce
- Save a session whose
workingDirectoryisC:\Work\Proj. - Call
sessionManager.listSessions({workingDirectory: 'c:\\work\\proj'}). In practice this happens when the same project is opened from a VS Code terminal (c:\...) and from PowerShell (C:\...).process.cwd()keeps the case it was started with.
Expected behaviour
The session is found (1 result).
Actual behaviour
listSessions('C:\\Work\\Proj') -> 1
listSessions('c:\\Work\\Proj') -> 0
listSessions('C:\\work\\proj') -> 0
listSessions('C:\\Work\\Proj\\') -> 0
A spec asserting 1 result for c:\work\proj fails (- 0 + 1). --continue and /resume last start a fresh session or report none.
Environment
Windows 11, Node v22.22.3, Nanocoder 1.31.0 (main at 948a4e74)
Suggested fix
source/session/session-manager.ts:389-391: compare with a shared case-aware path key (path.resolve, drop a trailing separator, lowercase onwin32), notpath.normalize(a) === path.normalize(b).- Related: issue #1689 and PR #1882 add case-insensitive comparison for trust and file tools but do not touch
session-manager.ts. Reuse that helper once it lands.
Hi @ShryukGrandhi please ask to be assigned on the issue first and wait for a maintainer to assign it before opening a PR.
can I take this? myplan: one helper that resolves the path, drops the trailing separator and lowercases on win32, then listSessions compares those keys instead of path.normalize equality. Spec covers the four cases in the report. If #1882 lands its helper first I reuse that one