Found while auditing config-path resolution after #75376ac (CODEX_HOME).
The question
install_hooks.rs hardcodes these:
pi_extension_path() → ~/.pi/agent/extensions/ai-memory.ts
omp_extension_path() → ~/.omp/agent/extensions/ai-memory.ts
Meanwhile ai-memory-workstream's harness adapter does honor env overrides for the same two agents when locating transcripts:
ManagedHarness::Pi => value("PI_CODING_AGENT_SESSION_DIR")
.or_else(|| value("PI_CODING_AGENT_DIR").map(|d| d.join("sessions"))),
ManagedHarness::Omp => value("PI_CODING_AGENT_DIR").map(|d| d.join("sessions")),
That is the same shape as the CODEX_HOME bug: one half of an install honors a home variable, the other half hardcodes $HOME, so with the variable set the hooks land where the agent never reads them and capture silently does nothing.
Why this is not simply fixed the same way
The internal evidence is contradictory, so I did not want to guess:
- The harness derives
$PI_CODING_AGENT_DIR/sessions, while the extension path is ~/.pi/**agent**/extensions — different nesting under the supposed same root. If PI_CODING_AGENT_DIR relocates ~/.pi, the extension path should become $PI_CODING_AGENT_DIR/agent/extensions, but that does not follow from the sessions path alone.
PI_CODING_AGENT_DIR governing OMP's ~/.omp is odd on its face and may be an unrelated reuse.
Guessing wrong reproduces the exact bug being fixed — writing extensions somewhere the agent will not load them — so this needs Pi's and OMP's own documentation rather than inference from this codebase.
What to check
- Does
PI_CODING_AGENT_DIR relocate Pi's whole config home, or only its session storage?
- Is there a separate variable for the extensions directory?
- Does OMP honor
PI_CODING_AGENT_DIR, or does it have its own?
If the answer is "it relocates the home", the fix mirrors codex_hooks_path_in: resolve via path_util::agent_config_home, add a two-branch test, and uninstall picks it up for free since it delegates to the same resolver.
Not affected
opencode_plugin_path and zero_hooks_path hardcode ~/.config deliberately — both carry a comment stating the policy, and install-hooks --config-file covers non-default XDG setups (verified working). Those are not part of this.
Found while auditing config-path resolution after #75376ac (
CODEX_HOME).The question
install_hooks.rshardcodes these:pi_extension_path()→~/.pi/agent/extensions/ai-memory.tsomp_extension_path()→~/.omp/agent/extensions/ai-memory.tsMeanwhile
ai-memory-workstream's harness adapter does honor env overrides for the same two agents when locating transcripts:That is the same shape as the
CODEX_HOMEbug: one half of an install honors a home variable, the other half hardcodes$HOME, so with the variable set the hooks land where the agent never reads them and capture silently does nothing.Why this is not simply fixed the same way
The internal evidence is contradictory, so I did not want to guess:
$PI_CODING_AGENT_DIR/sessions, while the extension path is~/.pi/**agent**/extensions— different nesting under the supposed same root. IfPI_CODING_AGENT_DIRrelocates~/.pi, the extension path should become$PI_CODING_AGENT_DIR/agent/extensions, but that does not follow from the sessions path alone.PI_CODING_AGENT_DIRgoverning OMP's~/.ompis odd on its face and may be an unrelated reuse.Guessing wrong reproduces the exact bug being fixed — writing extensions somewhere the agent will not load them — so this needs Pi's and OMP's own documentation rather than inference from this codebase.
What to check
PI_CODING_AGENT_DIRrelocate Pi's whole config home, or only its session storage?PI_CODING_AGENT_DIR, or does it have its own?If the answer is "it relocates the home", the fix mirrors
codex_hooks_path_in: resolve viapath_util::agent_config_home, add a two-branch test, anduninstallpicks it up for free since it delegates to the same resolver.Not affected
opencode_plugin_pathandzero_hooks_pathhardcode~/.configdeliberately — both carry a comment stating the policy, andinstall-hooks --config-filecovers non-default XDG setups (verified working). Those are not part of this.