* fix(omp): resolve XDG session root fallback * fix(omp): share profile-aware transcript root resolution * test: verify actual OMP XDG transcript discovery and reading * test(omp): satisfy reader smoke loop lint * test(omp): resolve vault fixture paths without redundant cache * fix(omp): refuse normalized Windows drive-relative roots
2.8 KiB
OMP transcript roots
Native chat lookup, history discovery and the history path allowlist use
src/main/ai-vault/omp-session-root.ts on the execution host. The resolver follows
the active runtime environment rather than scanning every profile.
The behavior matches OMP's packages/utils/src/dirs.ts:
- On Linux and macOS, an existing
$XDG_DATA_HOME/ompselects that app'ssessionsdirectory, even when legacy transcripts coexist. The sessions directory itself need not exist yet. There is no implicit~/.local/sharefallback. - A named profile uses XDG only when its own
omp/profiles/<name>path exists; otherwise it uses the profile's config-rootagent/sessionsdirectory. OMP_PROFILEtakes precedence overPI_PROFILE, including an explicitly empty canonical value. Named profiles ignore customPI_CODING_AGENT_DIRvalues. Default mode respects custom agent directories, except an inherited agent path derived from the lower-priority profile.PI_CONFIG_DIRselects the config root relative to the owning host's home, as upstream specifies.- Orca retains its legacy
OMP_CODING_AGENT_DIRsessions-root override and prefix normalization. Explicit scan roots override environment discovery. Empty or filesystem-root scan overrides and invalid profile names refuse discovery; they never fall back to a different profile or the process working directory.
The desktop scanner child allowlist forwards only the required directory/profile variables. SSH relay discovery still builds legacy roots from its host-owned home and does not gain XDG/profile discovery here. Client XDG/profile values are not applied to WSL home roots. Exact hook paths and existing WSL attestation/refusal remain authoritative. No wire fields or opcodes change; older clients receive the existing session record shape.
This resolves environment-visible configuration. Per-command --profile choices
or directory values loaded only inside the agent are not inferred by a runtime
that never received them; hook-reported transcript paths remain the exact route.
Run the read-only upstream parity smoke with:
ORCA_BACKGROUND_LAUNCH=1 bun tests/tools/omp-session-root-upstream-smoke.mjs /path/to/oh-my-pi
The smoke uses disposable home/data roots and compares Orca's result with OMP's actual directory resolver. It makes no model requests. Unit tests also cover Windows XDG exclusion, legacy override normalization and refusal paths.
For actual persistence-to-reader validation, run:
ORCA_BACKGROUND_LAUNCH=1 bun tests/tools/omp-transcript-root-reader-smoke.mjs /path/to/oh-my-pi
This creates default and named-profile transcripts through OMP's SessionManager, with legacy directories still present, then resolves and decodes each by session ID through Orca's native reader. All files use disposable roots; no model runs.