Problem
On Unix, pi-web encodes project paths differently from native Pi when creating session directories.
Example for:
/home/neven/code/xyz.net
Native Pi uses:
--home-neven-code-xyz.net--
pi-web currently uses:
--home_-neven_-code_-xyz.net--
This means sessions created in pi-web are valid Pi JSONL sessions and can be opened directly with pi --session <file>, but native Pi clients that discover sessions by the standard per-project directory name (for example pi-web-ui) do not see them automatically.
I verified that changing EncodeProjectName() in internal/sessions/session.go to use Pi's native encoding fixes the issue globally: new sessions created from pi-web immediately appear in native Pi / pi-web-ui without symlinks or bind mounts.
Proposed change
Please consider either:
- Use Pi's native session-directory encoding by default on Unix, matching the coding agent's
SessionManager, or
- Add an opt-in compatibility setting, for example:
PI_WEB_SESSION_DIR_ENCODING=native
Native Pi's encoding is effectively:
- remove one leading path separator
- replace
/, \, and : with -
- wrap the result in
--
Example:
/home/neven/code/xyz.net
→
--home-neven-code-xyz.net--
pi-web already supports decoding/reading legacy/native directory names, so this would mainly make newly created sessions interoperable with other Pi clients.
Why this matters
The JSONL format itself is already compatible. The incompatibility is only the project-directory naming, but it prevents seamless sharing of sessions between:
pi-web
- native Pi CLI/TUI
- other Pi SDK clients such as
pi-web-ui
A native-compatible write mode would remove the need for per-project bind mounts/symlinks or maintaining a patched build.
Problem
On Unix,
pi-webencodes project paths differently from native Pi when creating session directories.Example for:
/home/neven/code/xyz.netNative Pi uses:
--home-neven-code-xyz.net--pi-webcurrently uses:--home_-neven_-code_-xyz.net--This means sessions created in
pi-webare valid Pi JSONL sessions and can be opened directly withpi --session <file>, but native Pi clients that discover sessions by the standard per-project directory name (for examplepi-web-ui) do not see them automatically.I verified that changing
EncodeProjectName()ininternal/sessions/session.goto use Pi's native encoding fixes the issue globally: new sessions created frompi-webimmediately appear in native Pi /pi-web-uiwithout symlinks or bind mounts.Proposed change
Please consider either:
SessionManager, orPI_WEB_SESSION_DIR_ENCODING=nativeNative Pi's encoding is effectively:
/,\, and:with---Example:
/home/neven/code/xyz.net→
--home-neven-code-xyz.net--pi-webalready supports decoding/reading legacy/native directory names, so this would mainly make newly created sessions interoperable with other Pi clients.Why this matters
The JSONL format itself is already compatible. The incompatibility is only the project-directory naming, but it prevents seamless sharing of sessions between:
pi-webpi-web-uiA native-compatible write mode would remove the need for per-project bind mounts/symlinks or maintaining a patched build.