Skip to content

fix(init): install Pi extension under .omp so OMP discovers it - #3347

Open
manateeJr wants to merge 1 commit into
rtk-ai:developfrom
manateeJr:fix/pi-extension-omp-discovery-path
Open

fix(init): install Pi extension under .omp so OMP discovers it#3347
manateeJr wants to merge 1 commit into
rtk-ai:developfrom
manateeJr:fix/pi-extension-omp-discovery-path

Conversation

@manateeJr

Copy link
Copy Markdown

Problem

rtk init --agent pi installs 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/extensions and ~/.omp/agent/extensions; .pi/extensions is not a discovery root. The extension is therefore written but never loaded, so no commands are rewritten and rtk gain shows no OMP activity.

Root cause

The install directory literals — not the extension code. OMP still honors the PI_CODING_AGENT_DIR env var, and its default agent dir is ~/.omp/agent, so pointing the paths at .omp aligns install, uninstall, and OMP's discovery.

Fix

  • src/hooks/constants.rs: PI_DIR .pi/agent.omp/agent, PI_LOCAL_DIR .pi.omp
  • src/hooks/init.rs: matching doc comments + test assertions
  • docs: hooks/README.md, hooks/pi/README.md, src/hooks/README.md, docs/guide/getting-started/supported-agents.md

The extension file (hooks/pi/rtk.ts), the --agent pi flag, the PI_* constant names, and PI_CODING_AGENT_DIR are unchanged. Paths-only, minimal.

Verification

Verified end-to-end against a live omp v17.0.6:

  • With the extension at ~/.omp/agent/extensions/rtk.ts, OMP loads it on startup via native discovery and its tool_call handler rewrites bash commands through rtk rewrite.
  • Example: ls -la /tmp/… was rewritten to rtk ls -la /tmp/…, executed, and logged in rtk's history at 94.4% savings — rtk gain now reflects OMP usage.

Gate: cargo fmt --all --check, cargo clippy --all-targets, and full cargo test all pass (the test_run_pi_mode_* / test_pi_* tests now assert .omp).

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.
@CLAassistant

CLAassistant commented Jul 31, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

2 participants