Skip to content

Feature: add --agent oh-my-pi (or alias omp) so rtk hook auto-loads under oh-my-pi #2194

Closed as not planned

Description

@jasonwill111

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:
    1. loadCapability(...) — native .omp/.pi capability API
    2. getAllPluginExtensionPaths(cwd) — installed plugins
    3. 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.ts confirms: oh-my-pi reads ~/.omp/agent/settings.json#extensions and plugin-installed packages; it treats the .omp namespace as first-class.
  • The omp-extension-roots.ts docstring also spells out the package layout: a registered extension root gets sub-discovered via sibling skills/, hooks/pre|post/, tools/, commands/, rules/, prompts/, .mcp.json directories.

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 omp to rtk init
  • Install to ~/.omp/agent/extensions/rtk/
  • Write a package.json declaring "omp" (and "pi" for backward compat) so oh-my-pi's loadCapability and Pi's loader both pick it up
  • Register the path in ~/.omp/agent/settings.json extensions: array
  • Reuse the same hooks/pi/rtk.ts source — the existing hook already subscribes to the right tool_call event 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 rewrite itself 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

  1. added
    enhancement
    good first issue
    help wanted
    on Jun 1, 2026
  2. pszymkowiak commented on Jun 1, 2026

    @pszymkowiak
    Collaborator

    wshm · Automated triage by AI

    🔍 Automated Triage

    ✨ Category feature
    🟡 Priority medium
    🎯 Confidence 92%

    Summary

    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

    This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.

    📁 Relevant files
    • hooks/pi/rtk.ts

    Triaged automatically by wshm · This is an automated analysis, not a human review.

  3. jasonwill111 commented on Jun 1, 2026

    @jasonwill111
    Author

    Superseded by #2166 — feat: add oh-my-pi (omp) as a supported agent by @oldschoola. That PR implements exactly what this issue describes (and the option A I suggested): rtk init --agent omp + oh-my-pi alias, ~/.omp/agent/extensions/rtk.ts global install path, hooks/omp/rtk.ts mirroring hooks/pi/rtk.ts, AgentTarget::OhMyPi clap 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:clienhancementgood first issuehelp wantedpriority:medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions