Repository navigation
feat(omp): support OMP (Oh My Pi) as a sixth harness - #85
Merged
Merged
Conversation
OMP loads project hooks from .omp/hooks/pre/*.ts when a session starts in the vault. The installer now writes one managed file, beyin-v3.ts, pinned to the vault and interpreter like the OpenCode plugin; BEYIN_VAULT and BEYIN_PYTHON override, the runtime file must be absolute and the hook fails open on any transport error. before_agent_start is the only injection channel, so the hook pins the SessionStart context and carries it into the first prompt; later prompts get their own turn context. tool_result(edit/write/patch), session_stop, session_before_compact and session_shutdown map to PostToolUse, Stop, PreCompact and SessionEnd. Outside-vault sessions register nothing. Tests port the OpenCode suite: installer plans/uninstall, engine parity with Claude for the same query, receipt/doctor acceptance, and Bun-driven lifecycle mapping plus fail-open cases (skip when bun is absent). One real OMP 18.2.8 session in a synthetic vault returned the canary fact and the queue acknowledged the lifecycle events.
OMP reports ctx.cwd without the macOS /private prefix and does not resolve symlinks, while the installer pins Path(vault).resolve(). The plain string comparison therefore missed the vault and the hook silently did nothing, which also failed the lifecycle test under the default macOS TMPDIR (/var -> /private/var). Resolve both sides with realpath (falling back to path.resolve when the path is missing) before the existing separator and case normalization. A new Bun case drives the hook through a symlinked cwd so the regression is caught on Linux too.
The list was copied from OpenCode. OMP 18 has no patch, apply_patch or multiedit tools (patch and apply_patch are modes of the single edit tool) and it does ship ast_edit, which rewrites files. Queue PostToolUse for edit, write and ast_edit, as listed in tools/builtin-names.ts.
OMP task sub-agents reuse the parent's discovered hooks (task/executor.ts passes preloadedExtensionPaths) and emit their own session_start, so every sub-agent ran the adapter, got memory context injected and queued events for a session that never submits a receipt. The executor appends a session_init entry to the sub-agent session before emitting session_start, and top-level sessions never carry one. Treat a session whose entries include session_init as a sub-agent and no-op for it, the same way the OpenCode plugin skips child sessions. The result is cached per session id because getEntries() copies the whole session.
…sses Copying beyin-v3.ts into ~/.omp/agent/hooks/pre adds nothing: outside the vault the hook does nothing, inside it the project hook of the same name wins, and the installer never updates or removes the global copy. Replace that advice in README.md, docs/v3/OMP.md and the hook/installer comments with a short warning, and document the canonical cwd match and the sub-agent skip. List OMP where Hermes and OpenCode are already listed: SETUP-V3.md step 5, the harness list in docs/v3/PLATFORM-TESTS.md and the client trust paragraph in beyin.md.
Owner
|
Merge edildi (ecab5d2). Üstüne dört maintainer commit'i eklendi:
CI'da Bun kurulu olmadığı için Bun'a bağlı OMP testleri orada atlanıyor; |
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 OMP (Oh My Pi) as a sixth harness alongside codex, claude, antigravity, hermes and opencode.
ompjoinsHARNESSES;--harness ompis accepted for receipts, context and doctor, rejected for prefs-only updates like every other harness.template/.claude/scripts/beyin_v3_omp.pygenerates a single managed TS hook at.omp/hooks/pre/beyin-v3.ts. It pins VAULT and interpreter at install time (the file may be copied into the global agent dir where the vault cannot be derived), honorsBEYIN_VAULT/BEYIN_PYTHON, requires an absolute runtime state and fails open on any transport error, mirroring the OpenCode plugin.session_start→SessionStart,before_agent_start→UserPromptSubmit (only injection channel, so SessionStart context is pinned into the first prompt),tool_result(edit/write/patch)→PostToolUse,session_stop→Stop,session_before_compact→PreCompact,session_shutdown→SessionEnd. Outside-vault sessions register and queue nothing. The first prompt queues both SessionStart and a real UserPromptSubmit, matching Claude.docs/v3/OMP.md, client lists inREADME.mdanddocs/v3/README.md, skill updates (--harness ompreceipt guidance, doctor connection check).Testing
tests/v3_omp_test.py(6 tests): installer plan/uninstall, engine context parity with Claude for the same query, receipt/doctor acceptance, Bun-driven lifecycle mapping and fail-open cases (broken runtime variants, missing interpreter). Bun cases skip when bun is absent.python -m unittest discover -s tests -p "v3_*test.py"→ 394 tests, OK (2 platform skips).ompSessionStart, UserPromptSubmit, Stop and SessionEnd with no hook error.