# Oh My Pi adapter

Shows the sessions of Oh My Pi, the coding agent `omp`, a fork of Pi, in the notch: working, done when a turn ends, needing you while it waits for your approval of a tool, an answer to its `ask` or the review of a plan, what the tool in use does, its first prompt, its repository and its branch as its name, and its tool calls as steps. **Its plan reviews are answered from Blossom**, with Approve or Keep planning and a note.
Oh My Pi has no hooks of the shell. It loads modules in TypeScript, its extensions, into its own process. Blossom installs one of its own, `~/.omp/agent/extensions/blossom.ts`, a copy of [`extension.ts`](extension.ts), which posts a few fields of each event to a Unix socket in your own folder, `~/Library/Application Support/Blossom/omp/socket`, where this adapter listens. Blossom launches the adapter.

**This adapter was written from the documentation and the source of Oh My Pi and was never run against a real one.** What they say and what is only supposed is in [../../documentation/roadmap/omp.md](../../documentation/roadmap/omp.md); the checks at the end say what to look at. Why Blossom installs a module, and what the module may and may not do, is in [the decision](../../documentation/decisions/module.md).

You need:

- Blossom. It includes this adapter and the Bun that runs it; from a clone, `bun run build` makes one.
- Oh My Pi, `omp`. The module follows its documentation, `docs/extensions.md` and `docs/extension-loading.md`, and the source of [can1357/oh-my-pi](https://github.com/can1357/oh-my-pi) at commit `b28e2104d02b69fca858746c2e1284beba543099` of 3 December 2026, after its release 19.4.1.

## Connect from Blossom

The quickest way. Blossom finds `omp` in your `PATH` or in the usual folders, `~/.local/bin` among them, where its install script puts it, and connecting it is one click: "Continue" on the second step of the introduction, with Oh My Pi checked, or its switch in Settings > Agents. Blossom then adds this adapter to its configuration, starts it, and writes `~/.omp/agent/extensions/blossom.ts`, readable by you alone, creating the folders it needs. No file of yours is changed: your other extensions stay as they are.

"Repair" in the row writes the module again when it is missing, when you changed it or when an update of Blossom brings another one; it keeps a copy of the file it replaces in `~/Library/Application Support/Blossom/backups/omp/`. "Disconnect", shown while the agent is off, takes the adapter out of Blossom and deletes `blossom.ts`, after the same copy. A file named `blossom.ts` there that is not Blossom's, because it does not name the socket, is left alone and the row says so. Blossom does not follow `PI_CODING_AGENT_DIR`, `PI_CONFIG_DIR` or the profiles of Oh My Pi, `--profile`: one that uses another folder does not load the module.

Oh My Pi loads its extensions when a session starts. A session that was open when you connected reports from its next start.

## Run Blossom with the adapter

From the root of the clone:

```sh
bun install && bun run bootstrap && bun run build
BLOSSOM_CONFIGURATION=adapters/omp/configuration.json apps/macos/build/Build/Products/Debug/Blossom.app/Contents/MacOS/Blossom
```

The notch shows nothing until a session of Oh My Pi reports. Run one Blossom at a time: the adapter holds the socket, and the adapter of a second Blossom logs `cannot listen for the extension of oh my pi` and exits.

### From Finder

An app opened from Finder reads `~/Library/Application Support/Blossom/configuration.json`. Name the adapter by its package:

```json
{ "adapters": [{ "package": "omp" }] }
```

## Install by hand

For a clone without the app:

```sh
mkdir -p ~/.omp/agent/extensions
cp adapters/omp/extension.ts ~/.omp/agent/extensions/blossom.ts
```

## Remove by hand

After an install by hand; after connecting from Blossom, Disconnect does it, and removing Blossom deletes the module, see [Removing it](../../documentation/privacy.md#removing-it).

```sh
rm ~/.omp/agent/extensions/blossom.ts
```

Oh My Pi can also turn it off without removing it, in `/extensions`, or with `disabledExtensions: [extension-module:blossom]` in its configuration.

## What to know

- **A review answered twice, or left.** The first answer wins in Oh My Pi. An answer in its terminal fires `plan_review_resolved`, on which the module drops its post, which withdraws the panel; an answer of the notch that arrives after it finds the review closed and changes nothing. If Blossom quits while a review waits, the post fails, the module answers nothing, and the review stays in Oh My Pi. No promise is left waiting: the module awaits nothing, and its timer ends with the post.
- **Plan reviews are answered from Blossom, or in Oh My Pi.** When Oh My Pi asks you to review a plan, the request panel shows it, in Markdown, with Approve and Keep planning. Approve answers `execute`, the first choice of Oh My Pi, which starts on the plan in a fresh context with the model selected in its slider; Keep planning answers `refine` with your note, or with "Keep planning: the plan was not approved in Blossom." without one, and Oh My Pi plans again with it. The picker of Oh My Pi stays open meanwhile and the first answer wins; an answer there withdraws the panel. Its other choices, keeping or compacting the context and saving the plan, are made in Oh My Pi. A review that gets no answer within fifteen minutes is left to Oh My Pi.
- **Approvals and questions are answered in Oh My Pi.** Between `tool_approval_requested` and `tool_approval_resolved`, and while its `ask` tool runs, the session needs you. No extension can answer an approval. Oh My Pi asks for approvals only in some modes, `always-ask`, `write` or rules of yours; its default, `yolo`, asks none.
- **What the module does.** It listens to `input`, `agent_start`, `tool_execution_start`, `tool_execution_end`, `agent_end`, `tool_approval_requested`, `tool_approval_resolved`, `plan_review_requested`, `plan_review_resolved`, `session_switch` and `session_shutdown`, and to nothing else: not to `tool_call` or `tool_result`, whose handlers can block or change a call. Every handler returns at once with nothing; the posts go one after the other in the background, one second each at most, and the review of a plan waits sixteen minutes at most. With Blossom closed, every post fails at once and Oh My Pi notices nothing. It imports `node:http` alone, reads no file and logs nothing. It skips the sessions of subagents, `ctx.agent.kind` `sub`.
- **One change in Oh My Pi.** Oh My Pi starts the subagents of a batch of `task` while their call streams, unless an extension listens to its approvals, `tool_call` or `tool_result`, as its documentation and its code say (`hasLifecycleHandlers` in `packages/coding-agent/src/speculation/host.ts`). This module listens to approvals, to show when one waits for you, so with it those subagents start only when the call ends; what they do is the same. The row of Oh My Pi in Settings > Agents says so. Disconnect, or turning the module off in `/extensions`, gives the speculative launch back. Whether to keep listening to approvals is a provisional decision, see [the roadmap](../../documentation/roadmap/README.md#pi-and-oh-my-pi-adapters).
- **What it sends.** The identifier of the session, its folder and the process of Oh My Pi with every event; the first 4096 characters of a prompt; the identifier of a call, the name of its tool, `path` of its arguments and whether it failed; whether a turn continues by itself; the identifier of a review and the text of its plan. Never a command, the content of a file, what a tool printed or an answer of the model. The adapter keeps the title, the name of the tool and the words of its step, the folder, and the plan only while its review waits.
- **A session shows up with its first prompt.** `input` starts a session, and so does `agent_start`, since `omp acp` and `omp -p` send no `input`. The title is the first line of the first prompt, cut to 60 characters; a prompt that starts with `/` or `!` titles nothing.
- **Steps are tool calls.** Each call is a step from its `tool_execution_start` to its `tool_execution_end`. `read`, `edit` and `write` show the name of their file without its folder when their arguments carry `path`; `edit` in its default mode carries none and shows "Editing a file"; `bash` shows "Running a command"; the others a label. A step still running when the turn ends is shown failed.
- **How a turn ends.** `agent_end` without `willContinue` is done; with it, Oh My Pi goes on by itself.
- **How a session ends.** `session_shutdown`, sent when the process ends, closes it; `session_switch`, after `/new`, a resume or a fork, closes the other sessions of the same process. A session whose `omp` was killed leaves within five seconds.
- **The terminal of a session.** With each prompt, the module sends the variables a terminal sets and the processes of Oh My Pi and of its parent; the adapter reads its terminal device with `/bin/ps` and checks every value as it checks those of a hook. Under `omp acp` the environment is the one of the editor, and a session has no terminal.
- **The socket is yours alone.** A process that runs as you can still post to it, listen on it while Blossom is closed, or answer a review in Blossom's place, as for the permissions of Claude Code. See [../../documentation/decisions/socket.md](../../documentation/decisions/socket.md).
- **Sixty-four sessions at most.** When a sixty-fifth starts, the adapter closes the one it heard from least recently.

### Not confirmed

Read in the documentation and the source, never seen in a run:

1. That Oh My Pi loads `~/.omp/agent/extensions/blossom.ts` through Bun and that `node:http` reaches a Unix socket from its binary.
2. That `ctx.resolvePlanReview` from a handler that already returned answers the review, as the documentation says.
3. That `tool_execution_start` carries `path` in the arguments of `read` and `write`.
4. That `session_switch` comes with the context of the new session, so the module names it.
5. That a session of `omp acp` reports through its `agent_start`.

## Checks by hand

The module was loaded into a double of the API of extensions of Oh My Pi, written from its source, and its posts reached the adapter through a real socket; it never ran inside Oh My Pi. Each check below needs `omp` signed in.

1. **It loads.** Connect Oh My Pi from Blossom, start `omp` in a new folder and open `/extensions`. *Is `blossom` listed and on, with no error?*
2. **A turn.** Ask `hi`. *Does the tile appear, titled `hi` and named after the folder, and turn green when the answer ends?*
3. **A tool.** Ask `read the file package.json`. *Does detail list `Read package.json` as a step?*
4. **A question.** Ask `ask me to choose between two options before you answer`. *Does the tile turn amber while `ask` waits?*
5. **An approval.** Set `tools.approvalMode` to `always-ask` and ask `run the shell command ls`. *Does the tile turn amber until you approve in Oh My Pi?*
6. **A plan.** Enter plan mode and ask for a plan. *Does the request panel open with the plan?* Press Approve. *Does Oh My Pi start on it?* Ask again and answer Keep planning with a note. *Does Oh My Pi plan again with your note?* Ask again and answer in Oh My Pi. *Does the panel leave?*
7. **The end.** Run `/new`. *Does the old tile leave?* Quit `omp`. *Does the tile leave?*
8. **Without Blossom.** Quit Blossom and ask `hi`. *Does Oh My Pi answer as before, with nothing printed about an extension?*
9. **Disconnect.** Disconnect Oh My Pi in Settings > Agents. *Is `~/.omp/agent/extensions/blossom.ts` gone, and your other extensions still there?*
