Add OMP (Oh-My-Pi) as a first-class importable provider#1177
Open
jms830 wants to merge 3 commits into
Open
Conversation
Parameterizes the Pi adapter over a PiFamilyConfig (binary name, home dir, env-var prefix, display label, MCP adapter marker) and ships OMP_FAMILY alongside PI_FAMILY. OmpRpcAgentClient is a thin subclass of PiRpcAgentClient that injects OMP_FAMILY. OMP and Pi share session lifecycle, history mapping, tool-call translation, permission dialog bridging, MCP adapter detection, and the --mode rpc client. Only the binary name (omp vs pi), home directory (~/.omp vs ~/.pi), env-var prefix (OMP_CODING_AGENT_* vs PI_CODING_AGENT_*), and display label differ. OMP sessions started outside Paseo (in the terminal) are discovered by reading ~/.omp/agent/sessions/**/*.jsonl via the new providers/omp/session-descriptor.ts. This mirrors the historical Pi descriptor (removed upstream in getpaseo#1154 in favor of runtime extension capture) but is scoped to OMP paths so it does not contradict the Pi direction — Pi continues to use paseo_capture_entries at runtime. Pi behavior is unchanged. All 34 pre-existing Pi tests pass. 11 new tests cover OMP-side session discovery, env-var precedence, family isolation (OMP cannot see Pi sessions and vice versa), and the OmpRpcAgentClient subclass surface.
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.
Closes #1176.
What
Adds OMP — Oh-My-Pi, a downstream fork of Pi — as a first-class provider alongside
claude,codex,opencode, andpi. OMP ships its own binary (omp), home directory (~/.omp), and plugin ecosystem, but preserves Pi's--mode rpcwire protocol and JSONL session schema verbatim.After this PR, OMP users can:
paseo provider ls, the in-app provider catalog, and the agent pickerpaseo import <session-id> --provider omp --cwd <cwd>extends: "omp"in~/.paseo/config.jsonWhy
OMP is a real-world Pi fork with its own
ompCLI and~/.omp/agent/sessions/<sanitized-cwd>/<ts>_<uuid>.jsonlstorage layout. Today OMP users have two unappealing options:PI_CODING_AGENT_DIR=~/.omp/agent, define a custom provider withextends: "pi"andcommand: ["omp", "--mode", "rpc"]. The UI still calls it "Pi", session metadata gets stampedprovider: "pi", and any future Pi/OMP divergence breaks silently.OMP and Pi are binary-compatible (same JSONL header
{type:"session",version:3,id,cwd,...}, same RPC shape, samepi-mcp-adapterextension), so first-class support is a near-zero-cost integration that mirrors the existing Pi adapter pattern.How
The Pi adapter is parameterized over a new
PiFamilyConfig:PiRpcAgentClient/PiRpcAgentSession/PiCliRuntimeaccept the family via constructor and threadfamily.providerIdthrough allAgentStreamEventemissions,AgentPersistenceHandlemetadata, diagnostic output, and MCP adapter detection. Pi-side defaults (PI_FAMILY) are unchanged — all existing Pi tests pass byte-for-byte.OmpRpcAgentClientinproviders/omp/agent.tsis a thin subclass ofPiRpcAgentClientthat injectsOMP_FAMILYand overrideslistPersistedAgentsto use OMP-specific offline JSONL discovery (see next section).Registered in:
packages/server/src/server/agent/provider-manifest.ts—AGENT_PROVIDER_DEFINITIONSpackages/server/src/server/agent/provider-registry.ts—PROVIDER_CLIENT_FACTORIESpackages/server/src/shared/importable-providers.ts—IMPORTABLE_PROVIDERSpackages/server/src/server/persisted-config.ts—BUILTIN_PROVIDER_IDSpackages/server/src/server/daemon-e2e/agent-configs.ts—allProviderspackages/cli/src/commands/agent/import.ts—IMPORT_PROVIDER_LISTSession discovery: deliberately split from Pi
#1154 ("Rewind chat or files from any user message") removed
providers/pi/session-descriptor.tsand replaced Pi'slistPersistedAgentswithreturn [], because Pi now uses the runtimepaseo_capture_entriesextension to track session identity for sessions started inside Paseo.That works for Pi-launched-from-Paseo, but it doesn't help users who run
omp(orpi) directly in their terminal and later want to import that session into Paseo.For OMP this PR adds a new
providers/omp/session-descriptor.tsthat does offline JSONL discovery of~/.omp/agent/sessions/**/*.jsonl. It mirrors the historical Pi descriptor pattern (resolution order:OMP_CODING_AGENT_SESSION_DIR→OMP_CODING_AGENT_DIR/settings.json:sessionDir→<cwd>/.omp/settings.json:sessionDir→~/.omp/agent/sessions/) but parameterized overPiFamilyConfigso future Pi-family forks can reuse it.Pi continues to use the runtime extension path as its canonical import strategy. The OMP descriptor is scoped to OMP paths and does not alter Pi behavior.
If reviewers want Pi import restored on the same offline-JSONL path (e.g. by passing
PI_FAMILYtolistOmpPersistedAgentsand renaming the module toproviders/pi-family/session-descriptor.ts), it's a one-line wiring change from this shape. I left Pi untouched on this PR to keep the review surface minimal and not contradict #1154's direction.Testing
omp/session-descriptor.test.ts(default path, env override, settings override, project.omp/settings.json, symlinks, sort+filter, family isolation), 4 inomp/agent.test.ts(provider id, session provider id, end-to-endlistPersistedAgents, isolation fromPI_CODING_AGENT_DIR)npm run format:check,npm run lint,npm run typecheckclean across all 8 workspacesOmpRpcAgentClient.listPersistedAgents()against this dev's real~/.omp/agent/sessions/returned 5 well-formedPersistedAgentDescriptorobjects withprovider:"omp", correct cwds, titles, and JSONL nativeHandles.paseo provider ls --jsonshows OMP as a first-class entry.paseo agent import <id> --provider omp --cwd <cwd>reachesOmpRpcAgentClient.resumeSessionand spawns the realomp --mode rpcprocess.What this does NOT change
listPersistedAgents. Stillreturn [](the post-Rewind chat or files from any user message #1154 state).Files
packages/server/src/server/agent/providers/pi/family-config.tspackages/server/src/server/agent/providers/omp/agent.tspackages/server/src/server/agent/providers/omp/session-descriptor.tspackages/server/src/server/agent/providers/omp/session-descriptor.test.tspackages/server/src/server/agent/providers/omp/agent.test.tspackages/server/src/server/agent/providers/pi/agent.ts(parameterize over family,PI_PROVIDER→this.providerId, helpers take family arg, runtimeSettings becomes protected)packages/server/src/server/agent/providers/pi/cli-runtime.ts(accept family, default toPI_FAMILY)packages/server/src/server/agent/provider-manifest.ts,provider-registry.ts,shared/importable-providers.ts,persisted-config.ts,daemon-e2e/agent-configs.ts, CLIagent/import.tsdocs/providers.md,public-docs/supported-providers.md,CHANGELOG.md16 files, +1140 / -67 lines.
Follow-ups (out of scope here)
omp/session-descriptor.tstoproviders/pi-family/session-descriptor.tsif you want Pi imports restored on the same offline path.ompicon to the in-app provider catalog (matches Pi for now via the generic terminal icon).history-mapper.ts,tool-call-mapper.ts,rpc-types.tsintoproviders/pi-family/if OMP plugins ever start emitting JSONL frames Pi can't parse.