feat: add Oh My Pi (OMP) adapter + fix symlink path encoding on macOS#259
Open
ryancnelson wants to merge 2 commits into
Open
feat: add Oh My Pi (OMP) adapter + fix symlink path encoding on macOS#259ryancnelson wants to merge 2 commits into
ryancnelson wants to merge 2 commits into
Conversation
- Add internal/adapter/omp: thin adapter for Oh My Pi sessions (~/.omp/agent/sessions/) using the same JSONL format as piagent - Refactor piagent.Adapter to expose NewCustom(sessionsDir, id, name, icon) so format-compatible forks don't duplicate 1000 lines of parser - Fix projectDirPath to call filepath.EvalSymlinks after filepath.Abs, so /tmp → /private/tmp on macOS and session directories are found - Add test case covering the /tmp symlink scenario
OMP changed its session directory encoding from the legacy piagent absolute style (--path-encoded--) to a home/tmp-relative format: ~/devel/escrow → -devel-escrow /tmp → -tmp (or legacy --private-tmp-- if not yet migrated) /other/path → --other-path-- (legacy fallback) Add WithProjectDirFunc() to piagent.Adapter so forks can supply their own encoding without duplicating the 1000-line parser. OMP's register.go provides the correct implementation matching packages/coding-agent/src/ session/session-manager.ts getDefaultSessionDirName().
Author
|
oh, cool, you're also from Seattle, marcus. also: sweet OG github username |
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.
What
Adds support for Oh My Pi sessions in the conversations plugin.
OMP is a fork of Pi Agent. It uses the identical JSONL format but stores sessions under
~/.omp/agent/sessions/<encoded-path>/instead of~/.pi/agent/sessions/. Without this adapter, OMP users get an empty conversations tab despite having a full session history sitting on disk.Transparency
This PR was written by an OMP session, for OMP itself — approximately 85% vibe-coded, with Claude Code running inside the Oh My Pi harness. I figured that was worth disclosing rather than pretending otherwise. The humans involved are me (the OMP session) and Ryan Nelson (who was watching and said "neat" when the sessions appeared).
Changes
internal/adapter/piagent: refactor + bugfixNewCustom(sessionsDir, id, name, icon string)— exposes a constructor so format-compatible forks don't have to duplicate ~1000 lines of parser logic.New()now delegates to it.projectDirPathsymlink fix —filepath.Absdoesn't resolve symlinks. On macOS,/tmpis a symlink to/private/tmp, so the encoded directory came out--tmp--instead of--private-tmp--, and Detect() always returned false. Fixed withfilepath.EvalSymlinks. This bug affects any macOS user running sidecar with--project /tmp(or from a symlinked path) regardless of which adapter they're using — OMP just surfaced it first.Test added to
TestProjectDirPathcovering the/tmpcase.internal/adapter/omp: new package (2 files)doc.go+register.go. The entire adapter is:cmd/sidecar/main.goBlank import to wire the
omppackage'sinit()into the binary.Testing
Verified live against an actual OMP session (this one) running from
/tmp. Sessions tab went from empty to showing 3 sessions, including the current conversation.