Repository navigation
Description
Summary
rtk init --agent pi --global installs the hook to ~/.pi/agent/extensions/rtk.ts, but oh-my-pi does not auto-load extensions from that directory. As a result, rtk token savings are silently disabled when running oh-my-pi, even though the binary and the Pi extension code are present and correct.
This is becoming increasingly common now that the Pi ecosystem has split into upstream Pi and the oh-my-pi fork (40+ providers, 32 built-in tools, etc.), and rtk v0.42.0 just shipped --agent pi support.
What I found
Verified against can1357/oh-my-pi source on main (commit around v15.5.11):
packages/coding-agent/src/extensibility/extensions/loader.ts—discoverAndLoadExtensions()only loads extensions from three sources, in this order:loadCapability(...)— native.omp/.picapability APIgetAllPluginExtensionPaths(cwd)— installed plugins- User-configured paths from
settings.json
- It does not scan
~/.pi/agent/extensions/(the directory rtk writes to). packages/coding-agent/src/discovery/omp-extension-roots.tsconfirms: oh-my-pi reads~/.omp/agent/settings.json#extensionsand plugin-installed packages; it treats the.ompnamespace as first-class.- The
omp-extension-roots.tsdocstring also spells out the package layout: a registered extension root gets sub-discovered via siblingskills/,hooks/pre|post/,tools/,commands/,rules/,prompts/,.mcp.jsondirectories.
So rtk's TypeScript hook works fine — the problem is purely install-target.
Reproduction
# 1. Install rtk 0.42.0+ and the Pi hook globally
rtk init --agent pi --global
ls ~/.pi/agent/extensions/rtk.ts # exists ✅
# 2. Run oh-my-pi and ask it to run any tracked command
omp "git status"
omp "cargo test"
# 3. Compare against plain Pi
pi "git status"Expected: rtk gain --history shows rewrites for both pi and omp sessions.
Actual: only pi sessions show rewrites; omp sessions bypass the hook entirely (commands run raw).
Proposed solution
Add a new rtk init --agent omp (or --agent oh-my-pi) target that installs the extension as an oh-my-pi extension package rather than a raw Pi extension file.
Concretely, two reasonable shapes — option A is the smaller change:
Option A — minimal (recommended for v0.43)
- Add
--agent omptortk init - Install to
~/.omp/agent/extensions/rtk/ - Write a
package.jsondeclaring"omp"(and"pi"for backward compat) so oh-my-pi'sloadCapabilityand Pi's loader both pick it up - Register the path in
~/.omp/agent/settings.jsonextensions:array - Reuse the same
hooks/pi/rtk.tssource — the existing hook already subscribes to the righttool_callevent with no omp-specific code
Option B — full package
Same as A, but also drop sibling skills/, tools/, commands/ directories so omp users get the full sub-discovery surface omp-plugins.ts expects (per omp-extension-roots.ts docstring). Probably overkill for a token-savings-only extension; defer to follow-up.
Workaround (until shipped)
Manual copy + settings entry:
mkdir -p ~/.omp/agent/extensions
cp ~/.pi/agent/extensions/rtk.ts ~/.omp/agent/extensions/rtk.ts
# add to ~/.omp/agent/settings.json:
# { "extensions": ["~/.omp/agent/extensions/rtk"] }This works because the existing rtk.ts is path-agnostic — it only depends on the ExtensionAPI and pi.exec being available, both of which oh-my-pi provides.
Environment
- rtk 0.42.0 (Windows x86_64-msvc binary at
C:\Tools\RTK\rtk.exe) - oh-my-pi latest main (post-v15.5.11)
- Verified
rtk rewriteitself works in isolation:git status→rtk git status,cargo test 2>&1 | tail -20→rtk cargo test 2>&1 | tail -20,ls -la→rtk ls -la
Happy to send a PR if you can confirm which shape (A or B) you'd prefer, and which ~/.omp/agent/ paths your CI tests against. Also fine with this being a good first issue for a first-time contributor — the change is well-scoped.
Activity
pszymkowiak commentedon Jun 1, 2026
🔍 Automated Triage
featuremediumSummary
Feature request to add
rtk init --agent omp(oh-my-pi) support; well-scoped Option A install target is suitable for community contribution with a workaround available📁 Relevant files
hooks/pi/rtk.tsTriaged automatically by wshm · This is an automated analysis, not a human review.
jasonwill111 commentedon Jun 1, 2026
Superseded by #2166 —
feat: add oh-my-pi (omp) as a supported agentby @oldschoola. That PR implements exactly what this issue describes (and the option A I suggested):rtk init --agent omp+oh-my-pialias,~/.omp/agent/extensions/rtk.tsglobal install path,hooks/omp/rtk.tsmirroringhooks/pi/rtk.ts,AgentTarget::OhMyPiclap variant, 12 new tests, dry-run smoke verified.The only remaining blocker is the author's CLA — see the PR conversation. Once that's signed it should be merge-ready for 0.43.0.
Closing this in favor of tracking on the PR.