Repository navigation
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 PR seems replacing the extension to OMP completely instead of allowing it to adapt to either PI or OMP runtime |
Collaborator
|
Thanks for digging into where OMP actually looks for extensions. Develop now installs to those paths through a dedicated OMP agent added in #3707 (merged 2026-09-05): rtk init --agent omp writes .omp/extensions/rtk.ts locally or ~/.omp/agent/extensions/rtk.ts globally, sharing the same rtk.ts file with Pi and tracking ownership in a .rtk-agents sidecar. The .pi paths were kept on purpose so existing Pi installs keep working, which is the one part of this PR that was not taken. If you still hit a case where OMP cannot find the extension after rtk init --agent omp, please comment here or reopen. |
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).