feat(omp): add extension-based rewrite integration for Oh My Pi#1365
Open
makoMakoGo wants to merge 4 commits intortk-ai:masterfrom
Open
feat(omp): add extension-based rewrite integration for Oh My Pi#1365makoMakoGo wants to merge 4 commits intortk-ai:masterfrom
makoMakoGo wants to merge 4 commits intortk-ai:masterfrom
Conversation
Mirror opencode plugin pattern: check rtk on PATH once at extension load via Bun.which. If missing, register no tool_call handler and stay silent, avoiding the per-call spawn cost and sticky session-wide latch flag. Also document multi-extension chaining (downstream handlers observe the rewritten command), Bun runtime requirement, and the startup check in hooks/omp/README.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
abc616a to
915ef53
Compare
…rewrite # Conflicts: # docs/guide/getting-started/supported-agents.md # docs/guide/index.md
Author
|
I have used this pr for about 2 days on my omp. |
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.
Summary
Adds Oh My Pi (OMP) as a first-class RTK agent target via a runtime
extension that intercepts
tool_callevents for thebashtool andrewrites the command through
rtk rewrite.rtk init --agent omp/rtk init -g --agent omp./.omp/extensions/rtk.ts(project) or
~/.omp/agent/extensions/rtk.ts(global)registry (
src/discover/registry.rs); the TS file only dispatchesrtk rewriteand applies the resultopencode plugin's precedent of "rewrite = allow" rather than
replicating Claude's exit-3 ask semantics in-agent
rtkis not onPATHat load time, the extensionregisters no handler and stays silent (same pattern as the opencode
plugin's
await \$\which rtk``)--agent ompis mutually exclusive with--codex,--gemini,--opencode,--claude-md,--hook-only,--auto-patch,--no-patch,--copilot(validated invalidate_init_target_selection)pre-existing non-stock files are refused rather than clobbered
--showand--uninstallboth supported and scoped to the stockextension marker
Closes #591.
Review changes applied
Two rounds of review before opening:
packages/coding-agent/src/extensibility/extensions/to verifytool_calldispatch,ToolCallEventResultblock semantics, andBashToolInput.commandshape(
hooks/claude/rtk-rewrite.sh,hooks/cursor/rtk-rewrite.sh,hooks/opencode/rtk.ts) to avoid over-engineering relative toestablished RTK conventions. Peers have no spawn timeout, silent
catch {}, and no TS tests — so those suggestions were dropped. Thesurviving fix was the startup PATH check (from opencode) replacing
the per-call `rtkMissing` latch.
Test plan
(install + idempotent + stale reject + unmanaged reject + global + project)
conflicts rejected as expected
cleanly (self-contained, no `@oh-my-pi/pi-coding-agent` runtime
dependency that was causing `pi_natives` TLS failures on WSL2)
observed to be transparently rewritten to RTK's compact output
🤖 Generated with Claude Code