nanocoder icon indicating copy to clipboard operation
nanocoder copied to clipboard

[Bug] /resume last and --continue find no session when the working directory differs only by letter case

Open addyCooks opened this issue 1 month ago • 2 comments

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

  1. Save a session whose workingDirectory is C:\Work\Proj.
  2. 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 on win32), not path.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.

addyCooks avatar Nov 02 '26 16:11 addyCooks

Hi @ShryukGrandhi please ask to be assigned on the issue first and wait for a maintainer to assign it before opening a PR.

addyCooks avatar Nov 03 '26 06:11 addyCooks

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

definitelynotchirag avatar Nov 07 '26 22:11 definitelynotchirag