fix(init): install Pi extension under .omp so OMP discovers it - #3347
Open
manateeJr wants to merge 1 commit into
Open
fix(init): install Pi extension under .omp so OMP discovers it#3347manateeJr wants to merge 1 commit into
manateeJr wants to merge 1 commit into
Conversation
OMP (Oh My Pi) auto-discovers extensions from <cwd>/.omp/extensions and ~/.omp/agent/extensions, not .pi/. `rtk init --agent pi` wrote the extension to .pi/extensions, so OMP never loaded it and `rtk gain` showed no OMP activity. Point the install and uninstall paths at .omp (PI_CODING_AGENT_DIR is still honored; OMP's default agent dir is ~/.omp/agent). The extension code and `--agent pi` flag are unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
rtk init --agent piinstalls the TypeScript extension to.pi/extensions/rtk.ts(project) /~/.pi/agent/extensions/rtk.ts(global). The current Oh My Pi (OMP) runtime auto-discovers extensions only from<cwd>/.omp/extensionsand~/.omp/agent/extensions;.pi/extensionsis not a discovery root. The extension is therefore written but never loaded, so no commands are rewritten andrtk gainshows no OMP activity.Root cause
The install directory literals — not the extension code. OMP still honors the
PI_CODING_AGENT_DIRenv var, and its default agent dir is~/.omp/agent, so pointing the paths at.ompaligns install, uninstall, and OMP's discovery.Fix
src/hooks/constants.rs:PI_DIR.pi/agent→.omp/agent,PI_LOCAL_DIR.pi→.ompsrc/hooks/init.rs: matching doc comments + test assertionshooks/README.md,hooks/pi/README.md,src/hooks/README.md,docs/guide/getting-started/supported-agents.mdThe extension file (
hooks/pi/rtk.ts), the--agent piflag, thePI_*constant names, andPI_CODING_AGENT_DIRare unchanged. Paths-only, minimal.Verification
Verified end-to-end against a live
omp v17.0.6:~/.omp/agent/extensions/rtk.ts, OMP loads it on startup via native discovery and itstool_callhandler rewrites bash commands throughrtk rewrite.ls -la /tmp/…was rewritten tortk ls -la /tmp/…, executed, and logged in rtk's history at 94.4% savings —rtk gainnow reflects OMP usage.Gate:
cargo fmt --all --check,cargo clippy --all-targets, and fullcargo testall pass (thetest_run_pi_mode_*/test_pi_*tests now assert.omp).