Skip to content

fix(memory): isolate Pi prompts and support Windows installs - #165

Merged
Grivn merged 1 commit into
masterfrom
codex/issue-164-pi-portability
Oct 19, 2026
Merged

Grivn merged 1 commit into
masterfrom
codex/issue-164-pi-portability

Conversation

@Grivn

@Grivn Grivn commented Oct 19, 2026

Copy link
Copy Markdown
Member

Pi currently injects the shared Claude guide, including Task/sonnet delegation and a prohibition on writing memory from the main conversation. Native Windows also loses the guide and skill path when HOME is unset, and cannot execute npm's mnemon.cmd with execFileSync.

Closes #164.

Install Pi's direct-write guide and skill under prompt/pi/, preserving the shared Claude files regardless of setup order. Resolve the home directory with homedir(), align setup/detection/eject with PI_CODING_AGENT_DIR, and discover only Mnemon's own skill. Status calls resolve native executables and standard npm platform packages without a shell, with bounded output and a hard process timeout. Preserve ordinary executable lookup, including non-executable PATH shadows and unrelated script wrappers.

Observed behavior Before After
Guide sent to a real Pi 1.3.0 model request Claude-only delegation and conflicting write prohibition Pi guide allows direct mnemon remember / link
Windows with HOME absent Relative resource path and missing default guide User-profile paths and the Pi guide
Windows npm installation Generic status fallback Actual insight/edge counts
Pi and Claude setup in either order Pi consumes the shared Claude guide Separate guides survive reinstall and scoped eject

Validation uses isolated synthetic stores and no paid model calls:

  • Built the single product and passed make test.
  • Official Pi 1.3.0 CLI before/after with a deterministic local provider; fixed global, project-local and custom-directory runs each execute real recall, remember and verification commands through Pi's bash tool. Four model requests per scenario retain the injected content for comparison.
  • Eight real mixed-host setup/reinstall/eject scenarios pass, including Chinese/spaced paths and preservation of unrelated files.
  • Memory CLI E2E: 258/258; independent basic CLI smoke: 20 commands.
  • Focused runtime suite exercises installed extension bytes, original-asset controls, native/npm layouts, PATH compatibility, timeout and output bounds. These process tests remain in the explicit integration tier.
  • Native Windows run passes at this commit with Node 24.16.0: 27 pass, 0 failures, six Unix-only process cases skipped (those pass locally). All six real setup/raw-Node scenarios cover native and global/local npm layouts, default/custom directories, HOME unset, and original-asset controls. The npm fixtures use the repository launcher/target registry and built binary; actual Pi CLI sessions were run on macOS.

After updating Mnemon, rerun mnemon setup --target pi --yes with the original scope (--global for a user installation), then restart Pi or use /reload. The real Pi host probes verify loading, model-facing guidance and tool execution; they do not measure an LLM's compliance with the guide.

Install a Pi-specific direct-write guide without changing other hosts, and align global setup and eject with Pi directory overrides. Resolve native and npm-installed status binaries without a shell, use the system home directory, and bound child runtime and output.

Validated with go build -o mnemon ., make test, and 33 opt-in Pi callback/process regressions. Add old-asset controls and a native Windows Manual Integration route covering HOME-unset profiles, custom directories, and npm layouts.
@Grivn
Grivn merged commit 94c6231 into master Oct 19, 2026
5 checks passed
@Grivn
Grivn deleted the codex/issue-164-pi-portability branch October 19, 2026 19:57
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.

Pi integration injects Claude-specific guide.md (dead Task/sonnet instructions) and is not Windows-safe

1 participant