Skip to content

fix(sessions): use native Pi project directory encoding - #125

Merged
setkyar merged 1 commit into
mainfrom
fix/native-pi-session-directories
Sep 19, 2026
Merged

setkyar merged 1 commit into
mainfrom
fix/native-pi-session-directories

Conversation

@setkyar

@setkyar setkyar commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • write new sessions, forks, and clones to Pi's native per-project session directory
  • keep reading directories written with pi-web's previous _-/__ escape encoding
  • prefer the JSONL session header cwd when resolving lossy native directory names
  • document the compatibility behavior and add regression coverage

Fixes #114.

Details

Pi encodes a project path by removing one leading separator, replacing /, \\, and : with -, and wrapping the result in --. pi-web used a lossless Unix-specific encoding instead, so Pi clients doing current-project discovery could miss sessions created by pi-web.

Native encoding is inherently ambiguous for literal hyphens. This change therefore treats the session header's cwd as authoritative and only decodes the directory name as a fallback. Existing pi-web directories remain readable.

Validation

  • go test ./internal/sessions -count=1
  • go test ./... -count=1
  • go vet ./...
  • gofmt clean
  • git diff --check
  • make build

make check reached the frontend suite but encountered unrelated 5-second timeout failures in SessionHeader, SessionSidebarProjects, and SessionTree; those three files passed independently (3 files, 11 tests). No frontend files are changed by this PR.

@setkyar
setkyar merged commit ea8ff96 into main Sep 19, 2026
6 checks passed
@setkyar
setkyar deleted the fix/native-pi-session-directories branch September 19, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support native Pi session directory naming for cross-client compatibility

1 participant