Repository navigation
feat: report omp (oh-my-pi) sessions to lich - #18
Merged
Merged
Conversation
omp is the fifth harness and the second that loads a module instead of running commands: `--hook` and `--extension` are one list it `import()`s, so even the files it calls hooks are modules, never scripts fed a payload on stdin. `omp/lich.js` is the whole client, mirroring opencode/lich.js. The mapping, measured against omp v17.3.0 driving a real run at a stub listener: - session id from `ctx.sessionManager.getSessionId()` at `session_start` (omp exports nothing about the session to its process env) - `busy` on `input`, and on `turn_start` for the turns no input precedes - the tool line on `tool_call` - the git-status refresh on a `tool_result` from write/edit/bash/notebook - `done` plus the generated title when a turn settles `waiting` and `idle` are deliberately unreported: omp's approval event was never observed on a real run, and a name taken off a type declaration is a report that silently never fires; the process that would send `idle` is the one exiting. The outside-lich gate is in the module, not in a registration: omp discovers `~/.claude` and `~/.omp` wholesale, so a global install loads on every omp run on the machine. Needs `omp` registered as a provider id in lich; until then the session-start report is rejected and the other three land. The suite asserts that payload against every contract rule except the one the missing fixture case trips, and goes back to the shared assertion on its own the day the case lands upstream.
# Conflicts: # CHANGELOG.md
5 of 6 tasks
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.
Adds a fifth harness. omp is the second one that loads a module instead of running commands:
--hookand--extensionare the same list, and itimport()s every entry — even the files it calls hooks are modules, never scripts fed a payload on stdin. Soomp/lich.jsis the whole client, mirroringopencode/lich.jsdown to the transport and the fire-and-forget rule.Mapping
Measured against omp v17.3.0 (
@oh-my-pi/pi-coding-agent), driving a realomp --hook … -p …run at a stub listener — not read off its documentation. The version is pinned in a comment in both the client and its suite, because 17.x moves fast.session_start, id offctx.sessionManager.getSessionId()busyinput, andturn_startfor the turns no input precedesbusy+ tooltool_calltool_resultforwrite/edit/bash/notebookdone+ titlesession_stop(title also re-read onturn_start)omp exports nothing about the running session to its own process env, so the context is the only source for the id and the title.
Deliberately absent
waiting. omp raisestool_approval_requested, but that was never observed on a real run here, and a name taken off a type declaration is a report that silently never fires. An omp card shows a spinner, not a bell, while the agent waits on you.idle. The process that would send it is the one exiting — same as opencode.The gate is in the module
omp discovers
~/.omp,~/.claude,~/.codexand~/.geminiconfiguration wholesale, and there is no per-harness registration to key on: a global install is loaded by every omp run on the machine. With no lich environment the factory subscribes to nothing at all, which the suite asserts.Needs from lich
ompis not a registered provider id upstream yet —tests/fixtures/session-start.jsonlcarries claude, codex, opencode and crush. The client sends"provider": "omp"because it is the only correct value; until lich registers it, that one report is rejected and the other three land. The fixture is upstream truth and is not edited here: the session-start assertion runs every contract rule except the one that case trips, and returns to the shared assertion on its own the dayrefresh-fixtures.shbrings the case down.Install (for
internal/agentplugin)Either drop the file in
~/.omp/agent/extensions/lich.js(omp scans that directory unprompted), or name any path inextensions:in~/.omp/agent/config.yml. Both measured. There is no manifest or marketplace entry of omp's own.Tests
tests/omp.test.mjs— 30 cases against the sametests/contract.mjsfixtures every other client answers to. Gate:node --test tests/*.test.mjs→ 157 pass, 0 fail.tests/refresh-fixtures.sh+git diff --exit-code -- tests/fixtures→ no drift.