Repository navigation
feat(omp) add OMP hook that rewrites bash tool calls through rtk rewrite - #1827
thedavemarshall wants to merge 2 commits into
Conversation
c9bd4d5 to
cc0f452
Compare
35b9e36 to
887f616
Compare
…uninstall OMP hook (hooks/omp/rtk.ts): - Intercepts bash tool_call events, delegates to `rtk rewrite` - Exit code 0 (allow), 1 (no equivalent), 2 (deny — silent passthrough), 3 (ask) - Thin spawner wrapper enables test injection without real subprocess - 2-second spawn timeout with cleanup - Fail-open: missing rtk, spawn errors, unexpected exits all passthrough Test suite (hooks/omp/tests/rtk.test.ts): - 13 behavioral tests covering all exit codes, error paths, edge cases - Mirrors Hermes test pattern with fake subprocess injection Discover integration (src/discover/): - AgentIntegrationStatus extended with omp_hook_installed detection - detect_from_home checks ~/.omp/agent/hooks/pre/rtk.ts - append_agent_notes reports OMP alongside Cursor and Hermes hook_check integration (src/hooks/hook_check.rs): - OMP hook path added to other_integration_installed detection - Tests cover OMP hook presence in empty-dir guard Init support (src/hooks/init.rs, src/main.rs): - `rtk init --agent omp` / `rtk init -g --agent omp` for project/global - OMP extension file installation with collision/idempotency checks - `rtk init --uninstall` handles OMP cleanup via uninstall_init_dispatch - run_omp_mode, install_omp_extension_file, uninstall_omp functions - OMP_GLOBAL_HOOK_PATH / OMP_PROJECT_HOOK_PATH constants Documentation: - README, supported-agents guide, TECHNICAL.md updated for OMP - Hook README documents installation paths and verdict behavior Signed-off-by: David Marshall <[email protected]>
887f616 to
8a23aa8
Compare
…ion cleanup uninstall_omp now returns Result<()> and owns the user-facing summary, while uninstall_omp_at returns Result<Vec<String>> silently — matching the split established by uninstall_hermes_at and uninstall_codex_at (PR rtk-ai#1614). Removes the discarded return value at the caller and the duplicated println! channel inside _at. Also: complete dependency injection in resolve_omp_agent_dir_from_env so the PI_CONFIG_DIR branch is unit-testable; drop the misleading underscore prefix on rtkMissingWarned (TS convention reserves _ for unused bindings); restore the blank line between tests in discover::report. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Hi @thedavemarshall, thanks for your contribution. There was already a MR for OMP here. And in the meantime Pi support has been merged. Could you sync with @makoMakoGo to see how to proceed? The OMP integration should build on Pi support, see if some mutualization could happen. Thanks |
|
This pull request has been automatically marked as stale due to 90 days of inactivity. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. Your contribution is very much appreciated — we're sorry we haven't been able to review it yet. |
|
Thanks for this. Oh My Pi support landed in #3707 on 2026-09-05, which installs the extension through the shared Pi file at ~/.omp/agent/extensions rather than a separate omp hook script, so the install, uninstall and hook paths here are now covered by a different layout. One thing this PR had that develop still lacks: |
Summary
Test plan
cargo fmt --all && cargo clippy --all-targets && cargo testandrtk init -g --agent omp` output inspectedgit statusgot re-written tortk git status