feat(omp) add OMP hook that rewrites bash tool calls through rtk rewrite#1827
Open
thedavemarshall wants to merge 2 commits into
Open
feat(omp) add OMP hook that rewrites bash tool calls through rtk rewrite#1827thedavemarshall wants to merge 2 commits into
thedavemarshall wants to merge 2 commits into
Conversation
thedavemarshall
commented
May 11, 2026
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]>
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
Test plan
cargo fmt --all && cargo clippy --all-targets && cargo testandrtk init -g --agent omp` output inspectedgit statusgot re-written tortk git status