Shows the sessions of OpenCode in the notch: working, done at the end of a turn, failed when a turn fails, what the tool in use does, its repository and its branch, its tool calls as steps and how many subagents run. Its permission requests are answered from Blossom, with Allow or Reject, and so are its questions of one choice. Once you turn acting on for OpenCode, Blossom can also start a session of OpenCode in a folder you chose, send a prompt to a session, its own or one you opened in OpenCode, and close a session it started.
OpenCode runs one background service per user, which the terminal, the desktop app and opencode run all connect to. The adapter connects to it as one more client: it reads the file where the service registers itself, subscribes to its events, and replies to a permission or a question, creates a session and sends a prompt the way OpenCode's own clients do. Nothing is installed in OpenCode and nothing of its configuration changes.
You need:
Blossom. It includes this adapter and the Bun that runs it; from a clone, bun run build makes one.
OpenCode 2, which runs the background service. Read from the source of v2.4.3. The maintainer tried it by hand against a real OpenCode on 3 December 2026, and it worked; which version of OpenCode it was is not written down. OpenCode 1 has no such service unless it is started with --port, and the adapter does not connect to it.
The quickest way. Blossom finds OpenCode on your Mac, and connecting it is one click: "Continue" on the second step of the introduction, with OpenCode checked, or its switch in Settings > Agents. Blossom adds this adapter to its configuration and starts it. It writes nothing outside its own configuration: there is no hook to install. "Disconnect", shown while the agent is off, takes the adapter out. See the decision.
bun install && bun run bootstrap && bun run buildBLOSSOM_CONFIGURATION=adapters/opencode/configuration.json apps/macos/build/Build/Products/Debug/Blossom.app/Contents/MacOS/Blossom
An app opened from Finder reads ~/Library/Application Support/Blossom/configuration.json. Name the adapter by its package, which Blossom includes, so neither a path nor Bun is needed:
{ "adapters": [{ "package": "opencode" }] }
If the file already exists, add the adapter to its adapters list instead. Then open apps/macos/build/Build/Products/Debug/Blossom.app. The adapter runs from inside the app, so moving or updating the app changes nothing in the file; how Blossom finds a package is in ../../documentation/architecture/adapters.md.
An app opened from Finder does not get the variables of your shell. If you set XDG_STATE_HOME, the adapter started from Finder looks in ~/.local/state and does not find the service; start Blossom from a terminal then.
Permissions are answered from Blossom, or in OpenCode. A request of OpenCode opens the request panel with Allow and Reject; OpenCode asks in its own interface at the same time, and the first answer wins. An answer in OpenCode withdraws the panel. Allow replies "once": Blossom does not offer "always", which saves rules the panel does not show. The title of the request is its kind and what it is about, such as shell git push origin main.
Questions of one choice are answered from Blossom. When OpenCode asks one question with one to four options to pick one from, Blossom asks it, and your pick is OpenCode's answer. Several questions, a choice of several options, more than four options, options whose names Blossom cannot tell apart, such as two that differ only by a space, and any other form stay in OpenCode, and the session needs you until you answer there. A custom answer can only be typed in OpenCode.
Subagents are part of their session. A subagent of OpenCode is a session of its own whose parent is the session that started it. The adapter never shows it as a session: it counts the subagents that work in the session you started, and raises their requests in it.
The name is the repository and the branch. OpenCode titles a session from your first prompt; Blossom does not show that title, which a model writes. The events it reads carry no prompt, so a session is named after the repository and the branch of its folder, read from HEAD and the pointers of .git at most once every five seconds, without running git: blossom · plugin/clocks, and the sessions of one repository stack. Outside a repository the name of the folder is the title. A step says what its tool does, from its name, such as Running a command or Editing a file. See ../../documentation/decisions/names.md.
A session shows up when it works. A session that was already working when the adapter connected shows at once, from the list of active sessions of the service.
A reply OpenCode refuses leaves the session needing you. If the service refuses or does not answer the reply to a permission or a question, the session turns amber and you answer in OpenCode.
A service that goes silent is left. The service sends a heartbeat every fifteen seconds; after forty-five seconds without a byte the adapter connects again.
Sessions leave when the service stops. When the stream of the service ends, because OpenCode stopped its service or restarted it, every session leaves the notch and pending requests are withdrawn: the events in between are lost. They come back with their next event. A session you delete in OpenCode leaves at once; a session you only stop using stays, done, until you dismiss it.
The service is reached on the loopback only. The adapter reads $XDG_STATE_HOME/opencode/service.json, or ~/.local/state/opencode/service.json, which OpenCode writes with the mode 0600. It reads the file only when it is a regular file of yours that nobody else can read or write, not a link or a pipe, of 64 KiB at most. It connects only to an http: address on 127.0.0.1, localhost or [::1] with nothing but a port after the host, only while the process the file names exists and is yours, and it never follows a redirect. So a file left behind by a service that crashed is not used, and the password it holds is not sent to whatever took the port since. A program of yours that took both the port and the identifier of the process would still get it. If you configured the service to listen on another host, the adapter does not connect.
The adapter holds the password of the service. That password lets a client do anything OpenCode can: prompt a session, run a command. The adapter subscribes to events, reads a session, and replies to permissions and forms; with acting on, and only when Blossom asks it, it also reads the permission rules of your default agent, creates a session, sends a prompt, interrupts a turn and archives a session Blossom started. Nothing else; it never writes the password anywhere, and never logs it. Any program running as you can read the same file.
Nothing is stored and nothing leaves the Mac. The adapter keeps in memory which session is the parent of which, the folder of each, the identifiers of pending requests, the names of running tools, which sessions Blossom started and which prompt of Blossom waits for its turn to end. The output of a tool and the metadata of a permission arrive inside the events it subscribes to and are dropped unread; it reads no prompt and no answer of the model, and it writes nothing to disk. A prompt you type in Blossom passes through the adapter to the service and is not kept, logged or put in an error.
Sixty-four sessions and sixteen requests at most. Blossom stops an adapter that lists more than 128 sessions or holds more than 32 requests. So when a sixty-fifth session works, the adapter closes the one it heard from least recently, and past sixteen pending requests a new one makes its session need you, and you answer in OpenCode.
A Blossom that is not running costs OpenCode nothing. The adapter is a client; OpenCode does not wait for it. With no service running, the adapter looks for the file every two seconds.
Off until you turn on "Let Blossom act on the sessions of OpenCode" in Settings > Agents. The adapter declares start, prompt and cancel for OpenCode; see the protocol. With the switch on, a new session of OpenCode starts from the new session panel, N in peek or "New session" in the command bar, as the notch says; the reply panel opens for an OpenCode session from its toast of done and from its detail with R; the steering form of a session that works shows Stop, Interrupt and Queue. No screen of Blossom closes a session, so closing is reached only over the adapter's standard input.
A new session is POST /api/session with the folder you chose, as Blossom sends it, and permission rules of its own; no agent and no model are named, so OpenCode uses your default agent and model, as for any new session. The adapter announces the session, then answers with its identifier.
It asks before commands, or before commands and edits. OpenCode allows everything by default and lets a client add rules to one session, after those of the agent, the last match winning. So the adapter reads the rules of your default agent for that folder, GET /api/agent, and gives the session, for shell, and for edit too when you chose "every edit": a rule that asks for everything, then each rule of the agent for that action, with allow turned into ask. A command your configuration denies stays denied; one it allows asks. Approvals you saved with "Allow always" in OpenCode still allow, as OpenCode applies them, and so does a plugin of yours that decides permissions. Other actions, such as web fetches and tools of MCP servers, follow your configuration. Subagents of the session inherit its rules. If the adapter cannot read the rules, it starts nothing.
A prompt is POST /api/session/:id/prompt with your text alone; the answer comes when the turn ends, from the events of the service: end_turn when it succeeds or fails, cancelled when it is interrupted. A prompt to a session the service does not know is refused as unknown.
A session you have open in OpenCode's terminal takes the prompt too: the terminal is a client of the same service, so the message is one more message of that session, and the terminal shows it and the turn (supposed, from the source; not run). Nothing is refused as held by another process: no other process writes the session.
Closing a session Blossom started interrupts its turn and archives it, PATCH /api/session/:id with archived: true; it stays in OpenCode's list of archived sessions, where you can restore it. A session Blossom did not start is never closed.
Stop and Interrupt interrupt the turn of any session of OpenCode the adapter follows, POST /api/session/:id/interrupt, whether Blossom sent the prompt or you typed it in OpenCode. A turn Blossom sent is interrupted once, and its prompt answers cancelled. Interrupt then sends what you typed as a new prompt, once OpenCode reports the turn ended.
OpenCode must be running. The adapter never starts OpenCode or its service. With no service, a new session or a prompt is refused, and Blossom says it failed; open OpenCode once and try again.
In a new worktree. When you choose "A new worktree" in the new session panel, Blossom makes the worktree itself with git, next to the repository, on a branch blossom/<name>, and the adapter creates the session with that folder as location.directory, like any other. OpenCode's own /api/worktree is not used: it makes no branch, runs the start command of the project in a shell, and removes without a check of the changes; see the decision. This is new behaviour that was not tried against a real OpenCode: checks 26 to 28 below are what to run first.
A session outlives Blossom, interrupted. It runs in OpenCode's service, not in a process of the adapter. When Blossom quits or turns the adapter off, the adapter interrupts the turn of each session Blossom started, within a second, and leaves it in OpenCode, not archived, where you can go on with it. A session you started is not touched. If the adapter is killed before, the session keeps working, still asking before what its rules say.
The adapter was tested against a server that speaks what the source of OpenCode 2.4.3 says. The maintainer tried it by hand against a real OpenCode on 3 December 2026, and it worked; the checks below are the list to run again when OpenCode or the adapter changes. Each check below needs OpenCode 2 and a provider. Write down what the line in italics asks.
Prepare once: run Blossom with the adapter, then, in another terminal, cd "$(mktemp -d)" and opencode.
The registration.ls -l "${XDG_STATE_HOME:-$HOME/.local/state}/opencode/service.json". Is it there, of mode -rw-------, while OpenCode runs?
A turn. Ask hi. Does the tile appear, named after the repository and the branch, or the folder outside a repository, with no badge, and turn green when the answer ends? That is session.execution.started and session.execution.succeeded.
A tool. Ask list the files of this folder. Does live show the tool, and detail list it as a step?
A permission answered in Blossom. Ask run the shell command touch probe.txt with a configuration that asks before running commands. Does the request panel show shell touch probe.txt? Allow it in Blossom. Does OpenCode withdraw its own prompt and run the command?
A permission answered in OpenCode. Ask again and answer in OpenCode. Does the panel leave the notch?
A rejection. Ask again and reject it in Blossom. Does OpenCode report the command rejected?
A question. Ask ask me to pick between two options, one question, before you answer. Does Blossom show the question with its options, and does your pick reach OpenCode?
Several questions. Ask ask me two questions at once before you answer. Does the badge turn amber, with no panel, and leave once you answer in OpenCode?
A subagent. Ask for a task that delegates to a subagent. Does one tile stay, with the number of running subagents in peek, and no second tile?
A failure. Use a model that fails, and ask hi. Does the tile turn red, and stay red after OpenCode goes idle?
An interrupt. Ask count from 1 to 300, one number per line and interrupt it. Does the tile turn green?
The service stops. Run opencode service stop, or quit every OpenCode. Do the tiles leave the notch? When OpenCode starts again and you ask hi, does the tile come back?
A second client. With the terminal open, ask something from the desktop app of OpenCode. Does its session show too?
The next checks act on OpenCode. Run them in order: each builds on the one before. All but 24 use the app; 24 drives the adapter over its standard input, since no screen closes a session. Use a scratch folder, cd "$(mktemp -d)", and write down the release of opencode. Keep opencode open in a terminal in that folder unless a check says otherwise, so its background service runs.
The switch. Open Settings > Agents. Is there "Let Blossom act on the sessions of OpenCode", off? Turn it on. Does "acting": ["opencode"] appear in the entry of the adapter in the configuration? If there is no switch, the adapter is not running or Blossom did not read capabilities from its manifest: look at its standard error.
A new session asks before commands. Press N in peek, or choose "New session" in the command bar. Is OpenCode offered as an agent? Pick it, "Choose a folder…" the scratch folder, "Asks you before" Commands, type run the shell command touch probe.txt and press ⌘↩. Does the panel close, the tile of the new session appear named after the folder, and a request shell touch probe.txt come to the notch? Reject it: no probe.txt exists. In OpenCode's terminal, list the sessions: is the new one there, in that folder, with your default agent and model? If no request comes and the file exists, the rules of the session did not take: a session Blossom starts asked nothing, which must never happen; stop and report it. If the panel says "Not started: OpenCode refused it.", look at the adapter's standard error.
Every edit. Start another session the same way, with Every edit, and create a file named probe.md. Does the edit ask? Allow it: the file exists. Start a third with Commands and the same text: no request, and OpenCode writes the file. If the edit asks under Commands, your configuration asks for edits, which is right; note it.
A rule you deny stays denied. Write {"permissions": [{"action": "shell", "resource": "git status", "effect": "deny"}]} as opencode.json of the scratch folder, start a session there with Commands and run git status. Does OpenCode refuse it without a request? If a request comes instead, a deny of your configuration became a question, which the rules of a session must never do. Delete the file after.
A reply to a session open in the terminal. In OpenCode's terminal ask hi and wait until the tile turns green. Click the toast of done: does it carry the reply icon and open the reply form, "Reply to OpenCode"? Type say PING-BLOSSOM in capitals and press ↩. Does OpenCode's terminal show your message and its answer, does the tile turn to working and back to green, and does the panel turn into the steering form and back to the reply form? This is decision 3 for OpenCode: if the terminal does not show the message, or shows it in another session, the shared service does not work as the source says, the reply forks the session out of sight, and the adapter must refuse sessions open in the terminal with -32010 instead; report it.
A reply from detail and the inbox. Open the inbox or peek, open the detail of that session, press R, click "Run the tests". Does the field fill without sending? Press ↩. Does OpenCode run it in the same session? If your configuration asks before commands, does the request come to the notch, and does an answer there reach OpenCode? A reply OpenCode refuses shows "Not sent: OpenCode refused it." under the field with your text kept; note what it said.
The queue. In OpenCode's terminal ask count from 1 to 300 slowly, one number per line. While it works, open its detail and press R. Does the steering form show Stop, Interrupt and Queue? Type then say QUEUED and press ↩. Does "Sent when it stops · 1" show it, and does OpenCode receive it only once the count ends? If Stop and Interrupt do not show, Blossom did not read the cancel the adapter declares.
An interrupt in OpenCode. Send the count from Blossom's reply form, then interrupt it in OpenCode's terminal. Does the tile turn green and the panel go back to the reply form? If it stays working, the adapter did not see session.execution.interrupted, and Blossom's prompt is still waiting.
Stop and Interrupt from the steering form. Ask the count in OpenCode's terminal. While it counts, open its detail in Blossom and press R. Press ⌘., then again within three seconds. Does the count stop, does OpenCode's terminal show the turn interrupted, does the tile turn green and the panel go back to the reply form? Ask the count again in the terminal, type say INTERRUPTED in capitals in the steering form and press ⌘↩. Does the count stop, and does OpenCode answer INTERRUPTED in the same session right after, shown in the terminal? Then send the count from Blossom's reply form and press Stop twice: does it stop the same way, with one interrupt? Do the same on the session of check 15, which Blossom started. If a stop does nothing, the interrupt did not reach the turn: note whether the terminal shows anything.
No service. Quit every OpenCode and run opencode service stop; the tiles of OpenCode leave the notch. Run pgrep -fl opencode. Start a session from the new session panel. Does it say "Not started: OpenCode refused it.", keeping what you typed, and does pgrep -fl opencode show nothing new? If an OpenCode process appears, something started it, which the adapter must never do. Open opencode again before the next check.
Closing, over standard input. Quit Blossom. From the root of the clone, bun run adapters/opencode/source/main.ts and type one line at a time:
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"protocolVersion":1}}: the manifest names "capabilities":{"start":true,"prompt":true,"cancel":true} for opencode.
{"jsonrpc":"2.0","id":1,"method":"session/new","params":{"agentId":"opencode","cwd":"<the scratch folder>","approval":"ask_before_commands"}}: a session/started comes before the answer, whose sessionId starts with ses_.
{"jsonrpc":"2.0","id":2,"method":"session/prompt","params":{"sessionId":"<it>","prompt":[{"type":"text","text":"say hi"}]}}: the answer to 2 is end_turn.
{"jsonrpc":"2.0","id":3,"method":"session/close","params":{"sessionId":"<it>"}}: session/closed, then an empty result, and the session shows among the archived ones of OpenCode, with its messages.
End with ctrl-D. Did anything typed in a prompt appear on standard error? It should not.
Quitting interrupts what Blossom started. Open Blossom again. Start a session from the new session panel with count from 1 to 300 slowly, one number per line, and ask the same in OpenCode's terminal in another session. While both count, quit Blossom. Does the session Blossom started stop counting within a second and stay among the sessions of OpenCode, not archived, and does the session of the terminal keep counting? If the session Blossom started keeps counting, the adapter did not interrupt it at exit: decision 4 does not hold for OpenCode.
A new worktree. In a scratch repository with one commit, git init probe && cd probe && git commit --allow-empty -m start, start a session from the panel with A new worktree, Commands and run the shell command touch probe.txt. Does the panel show "Making the worktree…", and is there ../probe.worktrees/run-the-shell-command-touch on the branch blossom/run-the-shell-command-touch?Does OpenCode list the new session in that folder, and does the request ask for touch probe.txt? Allow it: is probe.txt in the worktree and not in probe?
The project of OpenCode.Does OpenCode count the session under the same project as probe, and does peek stack it under probe with the branch blossom/…? Write down whether OpenCode shows the worktree among its own workspaces.
Removing it. With the session green, open the new session panel again. Is the worktree listed with "Kept: uncommitted changes"? Delete probe.txt in the worktree, open the panel again: does it show Remove, and do two presses remove the folder and the branch, leaving OpenCode's session in its list?