From c00d8a1b85548739d07d4e709798330b973c0aad Mon Sep 17 00:00:00 2001 From: omartelo Date: Thu, 13 Aug 2026 10:59:53 -0300 Subject: [PATCH] feat: report omp (oh-my-pi) sessions to lich 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. --- CHANGELOG.md | 28 +++ CLAUDE.md | 23 +- README.md | 21 +- docs/providers.md | 93 +++++++-- docs/session-start.md | 26 ++- docs/session-state.md | 52 +++-- docs/session-title.md | 14 +- docs/session-touched.md | 13 +- omp/lich.js | 166 +++++++++++++++ tests/omp.test.mjs | 452 ++++++++++++++++++++++++++++++++++++++++ 10 files changed, 826 insertions(+), 62 deletions(-) create mode 100644 omp/lich.js create mode 100644 tests/omp.test.mjs diff --git a/CHANGELOG.md b/CHANGELOG.md index c7dab69..b7cf12f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- **omp (oh-my-pi) sessions report to lich.** A fifth harness, and the second + that loads a module rather than running commands: omp merges `--hook` and + `--extension` into one list and `import()`s every entry, so even the files it + calls hooks are modules. `omp/lich.js` is the whole client — the session id off + `ctx.sessionManager.getSessionId()` at `session_start`, `busy` on `input` and + `turn_start`, the tool line on `tool_call`, the git-status refresh on a + `tool_result` from `write`/`edit`/`bash`/`notebook`, and `done` plus the + generated title when a turn settles. Install is the file plus a line: + `~/.omp/agent/extensions/lich.js`, or any path named in `extensions:` in + `~/.omp/agent/config.yml`. + + Two states are deliberately absent. Nothing reports `waiting`: omp has an + approval event, but it was never observed on a real run here, and a name taken + off a type declaration is a report that silently never fires — so an omp card + shows a spinner, not a bell, while the agent waits on you. Nothing reports + `idle` either, for the same reason no opencode session does: the process that + would send it is the one exiting. + + The gate lives in the module rather than in a registration. omp discovers + `~/.claude` and `~/.omp` configuration wholesale, so a global install is loaded + by every omp run on the machine; with no lich environment the factory + subscribes to nothing at all. + + Needs `omp` registered as a provider id in lich — until then the session-id + report is rejected and the card holds no id, while the other three land. + ## [0.9.2] - 2026-08-12 ### Fixed diff --git a/CLAUDE.md b/CLAUDE.md index 5da6912..5b92032 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,6 +1,6 @@ # lich-plugin -The agent side of the integration with **lich** — a harness that orchestrates agent CLI sessions. This companion plugin is how lich observes and acts inside a running session. It ships hooks — each following a contract documented in `docs/` — plus skills for work that targets lich itself. One plugin, packaged for **Claude Code**, **OpenAI Codex**, **opencode** and **Crush** from the same repository root. +The agent side of the integration with **lich** — a harness that orchestrates agent CLI sessions. This companion plugin is how lich observes and acts inside a running session. It ships hooks — each following a contract documented in `docs/` — plus skills for work that targets lich itself. One plugin, packaged for **Claude Code**, **OpenAI Codex**, **opencode**, **omp** (oh-my-pi) and **Crush** from the same repository root. ## Structure @@ -14,14 +14,17 @@ hooks/codex-hooks.json # hook registration, Codex hooks/crush-hooks.json # hook registration, Crush (hand-merged into crush.json) hooks/ # hook scripts ($CLAUDE_PLUGIN_ROOT/hooks/