Repository navigation
Wake Oh My Pi sessions from the Inbox - #3676
Merged
Merged
Conversation
The Pi extension's Inbox tool, and with it the reply wake, is on by default in Oh My Pi (resolvePiInboxTool), as its agent tool already is. OMP shares Pi's inboxTool.pi switch, whose default is off, and nothing turned it on for OMP: the Inbox's connect step finds the extension only in Pi's own settings.json. So an OMP session with the extension had no Inbox tool and nothing polled for its replies. The stdio MCP shim now sends as the Pi or OMP session its parent process claims (inbox/pi-sessions, read at each call), so a thread an OMP agent starts through an Inbox MCP server is that session's and the reply wakes it through the extension, instead of a ses_ id nothing wakes. The wake's send also handles OMP's sendUserMessage promise rejecting when it drops the message, as it does a throw.
- Installers run omp plugin install/upgrade @plannotator/pi-extension when omp is on PATH (time-bounded, never fails the install, pinned runs respected) - The Inbox knows Oh My Pi as its own agent: connect and Settings install the extension, no inboxTool key written, its own state in Settings - INBOX_TOOL_OMP_DEFAULT: the Inbox tool's own OMP default - MCP shim: client-confirmed identities win over the Pi parent claim; a claim older than the parent process is ignored - A send OMP rejects waits for the next idle tick (InboxDeliverLater), reported after 3 retries - inbox --help and docs: on in Oh My Pi, /restart, the shared pi key, the subagent caveat
…ve on uninstall, true wording
# Conflicts: # packages/inbox/components/AgentsSettings.tsx
…installers, the Inbox and uninstall
…n run, one install at a time, keep an overlapping install's record
…alling only when this run started it; the switch writes its own Installed line
# Conflicts: # apps/hook/server/inbox-help.ts # apps/hook/server/inbox-mcp-shim.ts # apps/marketing/src/content/docs/reference/environment-variables.md # apps/pi-extension/inbox.ts # docs/agent-guides/environment.md
…s Pi's does (test)
…un time cannot shift it
…nces `omp plugin link <path>` (and `omp plugin install <path>`) writes only a symlink (a junction on Windows) at <plugins>/node_modules/@plannotator/ pi-extension and a lock entry, never a manifest entry, so the installers, `plannotator update`, auto-update and the Inbox's connect step ran `omp plugin install` over a developer's linked checkout. install.sh, install.ps1, install.cmd and inbox-agents.ts now read that link as a local build, with the existing local-build line, and the tests use omp's real layout instead of `link:`/`file:` manifest specs omp never writes. The plugin folder now follows omp's dirs.ts: the XDG folder once $XDG_DATA_HOME/omp exists, on Linux and macOS only; the Windows scripts no longer read XDG_DATA_HOME. On omp 19.1 and later MCP servers run in omp's shared daemon by default, so a thread sent over the Inbox's MCP server is not signed as the session and a reply does not wake it: the two sentences saying it does are deleted. The `xd://` mentions this PR added are dropped (omp 19.1 replaced it).
…he subagent MCP sentence Oh My Pi keeps its plugins in ~/.omp/plugins instead of the XDG folder when another agent dir or a profile is in use, so a pin or a linked build there was missed and omp plugin install ran over it. The check now reads both folders; the install folder is unchanged. The Windows installers already read only ~/.omp/plugins.
…inbox-wake # Conflicts: # apps/hook/server/inbox-help.ts # packages/shared/config.ts
DuongCoder04
pushed a commit
to DuongCoder04/plannotator
that referenced
this pull request
Nov 29, 2026
Move the marker from f00a501 to b74c769 and list the additive ./inbox-* changes core 0.25.37 carries from backnotprop#4161, backnotprop#4172, backnotprop#4194, backnotprop#3595, backnotprop#4186, backnotprop#3676 and backnotprop#3598.
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.
A user reported that the Plannotator Inbox does not wake his agent in Oh My Pi (OMP), though he has the plugin installed.
Causes
inboxTool.piswitch, and that switch is off by default. Nothing turned it on for OMP: the Inbox's connect step found the extension only in Pi's own~/.pi/agent/settings.json, and OMP keeps its plugins in~/.omp/plugins. So an OMP session had noplannotator_inboxtool, and nothing polled for its replies. Every OMP test setinboxTool: { pi: true }by hand, which hid the gap.omp plugin install @plannotator/pi-extension, and the Inbox did not know OMP as an agent.plannotator inbox mcpsent each thread as a freshses_id, and the session the extension polls for never owned it./new, the wake kept polling for the old session (Pi extension: Inbox replies don't reach an Oh My Pi (omp) session started with /new #3564, fixed by Move the Inbox wake when Oh My Pi switches sessions #3644 after v0.29.0).Changes
No manual step is left for an OMP user.
scripts/install.sh,install.ps1,install.cmd): withomponPATH, they runomp plugin install @plannotator/pi-extension, oromp plugin upgrade @plannotator/pi-extensionwhen OMP's plugin manifest already lists it. Each run is time-bounded (PLANNOTATOR_OMP_PLUGIN_TIMEOUT, default 180 s; the whole process group is stopped), with stdin closed, from the home folder. It never prompts and never fails the install. On failure it says "could not install" or "could not update" with the matching command. The result is checked against this release, like the Pi step ("still X (this release is Y)" when npm lags). A listed package without a readable version is installed again. A version the person pinned in OMP (an exact version in OMP's manifest) is left as is: "pinned to X in OMP, left as is". A local build is left as is too: "is a local build in OMP (…), left as is". That is a symlink (a junction on Windows) at<plugins>/node_modules/@plannotator/pi-extension, which is allomp plugin link <path>andomp plugin install <path>write besides a lock entry, with the link's target in the line; or a git spec in the manifest. A pinned--versionrun installs nothing in OMP (OMP would record that exact version as a pin): it prints the command, and leaves an existing install as it is. The way off a pin is the unversionedomp plugin install @plannotator/pi-extension. It is skipped by--minimal, like the Pi step. Updates run the installer, so they upgrade it too.oh-my-pi). It is found byomponPATHor by the extension in OMP's plugin folder. If the extension is missing or unreadable, or lacks the OMP default (theomp-inbox-tool-defaultfeature in the extension's own package.json, so nothing is bumped at release), the connect step runsomp plugin install(orupgrade). At Inbox start this runs in the background, outside the 30 s connect limit, up to 180 s, one at a time; the window then says "Installed Plannotator's extension in Oh My Pi. Type /restart in each open Oh My Pi session to load it." A failure is said once and not retried until Plannotator or the installed extension changes. A version pinned in OMP, and a local build, are left alone; Settings says why ("A local build is installed in Oh My Pi, left as is."). Settings' switch and the first-run screen's one-click Connect do the same. NoinboxToolkey is written, because that key is Pi's too. Settings → Agents shows OMP's own state, and the Pi and OMP rows say "Oh My Pi and Pi share this switch." Turning OMP off and on again restores what Pi had (a Pi on by name stays on)./restartline. Pi's own switch clears what OMP's off remembered.plannotator uninstallrunsomp plugin uninstall @plannotator/pi-extensionwhen OMP's manifest lists it. A failure, or noomp, is a warning with the command, never an uninstall error. A local build is left and named.resolvePiInboxTooluses its own constant,INBOX_TOOL_OMP_DEFAULT. The switch is stillinboxTool.pi/PLANNOTATOR_INBOX_TOOL. Pi keeps its default (off).inbox/pi-sessions/<session>.<pid>.json), read at each call. On Oh My Pi 19.1.0+ this rarely applies: omp now runs stdio MCP servers in its daemon, shared across sessions by default (mcp.shared), so the shim's parent is the daemon, which claims no session, and an MCP send gets ases_id that no reply wakes. It applies withmcp.shared: false, on older omp, and on Pi. The extension's ownplannotator_inboxtool is the path that wakes an omp session. An identity the MCP client gives itself wins: Claude Code's, Qwen's per call, or T3's. A claim counts only if its file is no older than the parent process's start, so a claim left by a dead process under a reused pid is ignored.sendUserMessage(PromptDroppedError: it did not admit the message, e.g. an abort or its cost cap; a turn already running queues it as a steer instead), the reply waits for the next idle tick (InboxDeliverLater), up to 3 retries. After that it is reported.plannotator inbox --helpand the docs now say the tool is on in Oh My Pi, that/restartloads it, and that OMP reads Pi's key.Only the Inbox, the CLI shim, uninstall and the installers change. The Inbox is Bun-only, and the Pi server runtime is untouched. Claude Code, OpenCode and Pi's defaults are unchanged.
Brought up to date with main (28 Nov)
Held on 19 Nov until the Inbox turned on only when the person chooses it (#3729). Main is merged in (
a0c711095c, main atdc0fbb8d7e); no rebase.Conflicts, each kept both sides:
apps/pi-extension/inbox.ts: the extension registers the Inbox tool only whenresolvePiInboxToolallows it (on by default in omp) and main'sisInboxTurnedOn(dataDir)says the person turned the Inbox on. Imports and locals are the union (main'sPiTerminalPrompts, this PR'slaterTries).apps/hook/server/inbox-mcp-shim.ts: imports only (this PR's claim reader, main'sINBOX_OFF_LINEand the gate).apps/hook/server/inbox-help.ts: main's new wording for DeepSeek Harness, Cline, Hermes, OpenClaw and T3, plus this PR's Oh My Pi bullet unchanged; main's "Once the person has turned the Inbox on here…" paragraph with this PR's two Oh My Pi clauses put back word for word.apps/marketing/…/environment-variables.mdanddocs/agent-guides/environment.md: main's rows, with this PR's Oh My Pi additions put back.bun install --frozen-lockfileleftbun.lockunchanged;scripts/mobile/check.tsis in step.The "only when chosen" rule (#3729), checked for every place this PR writes into Oh My Pi:
install.sh,install.ps1,install.cmd) runomp plugin install|upgrade @plannotator/pi-extensionwhen the person runs the installer, as main's installer already runspi installfor Pi. That installs Plannotator's extension. It does not write aninboxToolkey, an MCP entry or the Inbox mark, so it does not turn the Inbox on.connectInboxAgents. That runs only on the person's own non-detachedplannotator inboxor--no-open, the first--open, and the control route thatplannotator inboxuses while an Inbox is running. It never runs on a detached start,ensureInboxRunningor the shim. It also runs only for an agent with no record yet, so an Oh My Pi the person turned off or removed is never added back.inbox-omp-tool-default.test.ts, "OMP's default never turns the Inbox on". It fails without the gate.plannotator uninstall: removes the extension; the person runs it.Also fixed:
processStartedAtMsreadpsin the inherited time zone but parsed in the runtime's. On macOS, withTZchanged at run time (Bun keeps that out of a child's environment), the start time was off by hours, and the shim test failed locally. CI runs on Linux, which reads/proc.psnow runs in UTC and the time is parsed as UTC.Independent review fixes (27 Nov,
6b96a47a6e, main merged atc298e42a7d)omp plugin link(andplugin install ./path) writes only the node_modules symlink and a lock entry (oh-my-piplugins/manager.tslink,directory-link.ts). The old check read only manifest specs, so the installers,plannotator update, auto-update and the first Inbox connect ranomp plugin installover a developer's link. Now all four (install.sh,install.ps1,install.cmd:UpdateOmpExtension,inbox-agents.tsompExtension) treat that symlink or junction as a local build, with the existing local-build line. The fakedlink:/file:manifest tests are replaced by omp's real layout (symlink + lock entry, with and without a manifest); uninstall now also leaves and names a linked build.dirs.tspicks it:$XDG_DATA_HOME/omp/pluginsonce$XDG_DATA_HOME/ompexists, on Linux and macOS only, else~/.omp/plugins(no longer both). install.ps1 and install.cmd no longer readXDG_DATA_HOME.reference/inbox.mdandapps/pi-extension/README.md.xd://dropped from this PR'senvironment.mdrow, theinbox.tsheader and theconfig.tscomment.Verified / not verified
ompfor the installers and the Inbox) and on reading omp's source at 19.2.1.<plugins>/package.jsondependencies;ctx.isIdle(),ctx.hasPendingMessages()andsessionManager.getSessionId()exist;agent_settledevent, so the wake waits for idle alone, as on old Pi;sendUserMessagewith nodeliverAsstarts a turn, and its user message emitsmessage_start, which is when the wake counts it as delivered;sendUserMessagereturns a promise that rejects withPromptDroppedError(18.18.2+).xd://devices with tool commands. An extension tool is still one line in the system prompt, but its schema comes from<tool> --help. This PR's ownxd://mentions are dropped; main's agent-tool docs (README, installation.md, plan-review.md) still sayxd://.scripts/install.test.ts345 pass, 114 skipped (nopwshhere; CI runs the Windows installer tests under pwsh);scripts/install.test.ts -t "OMP|Oh My Pi"19 pass for install.sh (ps1/cmd needpwsh: CI);apps/pi-extension/inbox.test.ts(it runs a real Pi) andinbox-help.test.ts(it starts an Inbox).Tests
scripts/install.test.ts: a fakeompcovers install, upgrade, already current, failure, exit 0 without the manifest entry, a hang stopped at the time limit, a pinned run, a version pinned in OMP, a failed update, npm behind the release, an unreadable package, a hang (its child process is stopped too),--minimal, and noompon PATH. These run for install.sh, and under PowerShell for install.ps1 and install.cmd (whenpwshexists). It also checks the closing section and that the install.cmd PowerShell has no characters cmd.exe would read.packages/server/inbox-agents-omp.test.ts: the start installs in the background from the home folder and writes noinboxToolkey; an install slower than the total limit still finishes; one at a time; a failure is not retried under the same version and is after an update; npm lacking the release is said and not refetched; an unreadable package is reinstalled; a pin is left alone; OMP off and on restores a Pi on by name; the repo's extension carries the feature marker. It upgrades 0.29.0, runs nothing for a current extension, leaves a tool turned off by name alone, reports a failure and retries it, and Settings' switch installs, turns off and back on. Pi is not touched.packages/inbox/connectSteps.test.ts: OMP without the extension is a one-click Connect, its tool-off step has no cost, and a pinned old extension is no step, with why.packages/inbox/agents.test.ts,connectLine.test.tsx: a background install is news in the band, with the/restartline.packages/inbox/agentsSettings.test.tsx: the shared-switch line on both rows, and the pinned reason.packages/server/uninstall.test.ts:omp plugin uninstallruns; its failure and noompare warnings with the command.apps/hook/server/inbox-mcp-shim-pi.test.ts: the parent's start time is right under a non-UTCTZ;psis never run without a claim file for the parent; a stale claim is ignored, a Claude Code client keeps its own identity, and the parent claim beats an inherited tag (deliberate).apps/pi-extension/inbox-omp-dropped-send.test.ts: a send OMP drops once is delivered once with no report; one it always drops is reported after 4 sends.apps/pi-extension/inbox-omp-tool-default.test.ts: the tool is on in OMP by default, off on Pi, and off in OMP when config or env says so.Check it in a real Oh My Pi
These were not run against a real OMP session. To check:
omp plugin listshows@plannotator/pi-extension.plannotator inboxonce, then start OMP with noinboxToolin~/.plannotator/config.json. The agent hasplannotator_inbox, and Settings → Agents shows Oh My Pi connected.{ "inboxTool": { "pi": false } }and run/restart. The tool is gone and nothing polls.plannotator inbox mcpto OMP'smcp.jsonand have the agent ask a:::questionthrough it. With omp ≥ 19.1's default (mcp.shared) expect ases_id and no wake; withmcp.shared: falsethe thread's author is "Pi" with the OMP session id, and the reply arrives in OMP as a new turn.sh -c "plannotator inbox mcp"or through npx. Expect a fallback to ases_id (the shim's parent is then the shell, not OMP)./new(and/resumeinto another session) and send through MCP again. The author follows the new session, and the reply wakes it.tasksubagent and, while it runs, send from the main agent through MCP. The author should be the main session. A subagent in the same process can take over the claim for a moment (documented, not fixed).kill -9an OMP: itsinbox/pi-sessions/<session>.<pid>.jsonstays, and a new process with that pid does not pick it up.omp plugin install @plannotator/pi-extension </dev/nullfrom ~. Check: no prompt; exit 0; the manifest is~/.omp/plugins/package.json(withXDG_DATA_HOMEset, where?); which spec it writes (^xor exact).omp plugin upgrade @plannotator/pi-extensionagainst an exact pin. Does it override the pin? (The installer and the Inbox leave a pin alone either way.)omp plugin installon a package that is already installed. Does it reinstall or error? This is the Inbox's path when the package can't be read.omp plugin installat about 3 s, then at about 10 s. What is left in the plugins folder? Does OMP start? Does a rerun repair it? Does a bun or npm child outlive a TERM to omp?/restartline.plannotator uninstallremoves it withomp plugin uninstall @plannotator/pi-extension; withompgone it warns with the command and finishes.ompa.exeor a.cmd? Install from PowerShell 5.1 and from install.cmd; the time-limit kill.processStartedAtMs(pid)against the real start of an OMP. A live claim is accepted right after OMP starts.omp plugin link ./apps/pi-extension): the installer says "is a local build in OMP (), left as is", the Inbox's Settings says "A local build is installed in Oh My Pi, left as is.", and the link is still a link afterwards.omp plugin install @plannotator/pi-extensionrecords (expected^x), and which…@x.y.zrecords (expected exact; why a pinned installer run no longer installs one).omp plugin installover a disabled plugin turns it back on (OMP's docs: a reinstall resets enablement). Only the Inbox's "package can't be read" path and the pin advice do this.omp plugin uninstall @plannotator/pi-extensionexits 0 and removes the manifest entry.set -mundercurl | bashwith no tty (CI or Docker) and under macOS /bin/bash 3.2: omp gets its own group, or the kill falls back to the pid.