feat(ce-compound): recognize oh-my-pi (omp) session history - #1333
feat(ce-compound): recognize oh-my-pi (omp) session history#1333caelaxie wants to merge 1 commit into
Conversation
Add omp as a fifth session-history platform alongside Claude Code,
Codex, Cursor, and Pi:
- discover-sessions.sh: new discover_omp() + --platform omp arm.
Scans ${PI_CODING_AGENT_DIR:-$HOME/${PI_CONFIG_DIR:-.omp}/agent}/sessions
and named-profile roots, honors a flat PI_CODING_AGENT_SESSION_DIR
override, probes both omp bucket naming schemes (raw -<home-rel> /
--<abs>-- restored in 17.2.9, and sanitized-basename + sha256), and
dedups against the shared pi override.
- extract-metadata.py: try_omp runs before try_pi (omp files begin
with a 256-byte title-slot line); platform identity is omp.
- extract-skeleton.py / extract-errors.py: reuse pi extraction with
the title-slot line skipped.
- session-historian prompt + ce-compound docs: omp added to the
platform, cwd, keyword-rerun, and provenance contracts.
- Tests: omp fixture, discovery across default/named profiles and env
overrides, raw + hashed bucket probes, dedup, extraction reuse, and
a historian-contract regression guard.
Split out of EveryInc#1323 per maintainer request so the omp install work is
not blocked behind omp's still-moving session-bucket naming (17.2.9
restored the raw scheme days after the hashed scheme shipped).
Part of EveryInc#1224.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dc8d8b1ecb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| local sanitized | ||
| sanitized="$(printf '%s' "$REPO_NAME" | sed -E 's/[^a-zA-Z0-9._-]+/-/g; s/^-+//; s/-+$//' | tail -c 80)" | ||
| [ -n "$sanitized" ] || sanitized="project" | ||
| local agent_dir="${PI_CODING_AGENT_DIR:-$HOME/$config_dir/agent}" |
There was a problem hiding this comment.
Search omp's XDG session roots
When an omp install has migrated to XDG storage (for example $XDG_DATA_HOME/omp exists, so getSessionsDir() resolves sessions to $XDG_DATA_HOME/omp/sessions and flattens the agent/ prefix), this fallback only searches the legacy $HOME/.omp/agent/sessions tree. In that environment the new omp support reports files_processed: 0 even though recent omp sessions exist, so Full-mode session history silently misses the platform it is adding; include the XDG data/profile session roots in the root list before globbing.
Useful? React with 👍 / 👎.
Summary
Adds oh-my-pi (
omp) as a fifthce-compoundsession-history platform alongside Claude Code, Codex, Cursor, and Pi. Split out of #1323 at maintainer request (#1224 (comment)) so the omp install work is not blocked behind omp's still-moving session-bucket naming — 17.2.9 restored the raw bucket scheme and dropped its automatic migration days after the hashed scheme shipped, so both shapes now exist in the wild.Part of #1224.
What changed
Discovery —
discover-sessions.shdiscover_omp()+--platform omparm. Scans${PI_CODING_AGENT_DIR:-$HOME/${PI_CONFIG_DIR:-.omp}/agent}/sessionsand named-profile roots~/.omp/profiles/*/agent/sessions, and honors a flatPI_CODING_AGENT_SESSION_DIRoverride.-<home-rel>/-tmp-<rel>/--<abs>--scheme (current again since 17.2.9, verified against the installed 17.2.9 sourcesrc/session/session-paths.ts) and the intermediate hashed<scope>-<sanitized-basename>-<sha256>scheme. The raw probe canonicalizes--cwdwith physical paths to mirror omp'sresolveEquivalentPath; the basename glob covers both raw and sanitized forms so buckets are found even when--cwdcannot be resolved.allarm deduplicates the combined discoverer output (awk '!seen[$0]++'), since the sharedPI_CODING_AGENT_SESSION_DIRflat override is scanned by bothdiscover_pianddiscover_omp. Exact repo attribution stays with the downstream headercwdfilter — no bucket-name parsing is reimplemented for attribution.Extraction —
extract-metadata.py,extract-skeleton.py,extract-errors.pytry_ompruns beforetry_pi: omp session files physically begin with a 256-byte{"type":"title",...}slot line before the pi-shapedtype:"session"header, which distinguishes them from pi files. Platform identity isomp.title_changeentries are unaffected.Prose contracts
ce-compoundSKILL.md session-root list and keyword-rerun clause (branchless omp metadata gets keyword extraction and amatch_countthe relevance gate can evaluate).session-historian.md: input contract (platform=omp,cwdas Codex/Pi/omp metadata), cross-tool synthesis coverage, and provenance header.docs/skills/ce-compound.mdplatform enumeration.Tests
tests/fixtures/session-history/omp-session.jsonl(title-slot line + pi-shaped entries).tests/session-history-scripts.test.ts: omp auto-detection (not pi), discovery across default profile / named profile / both env overrides,--platform omprestriction, raw-scheme exact probe, raw + sanitized basename globs, single- and all-platform dedup, skeleton + errors extraction.tests/skills/ce-session-historian-no-skill-tool.test.ts: historian omp platform-contract regression guard.Verification
bun test tests/session-history-scripts.test.ts tests/skills/ce-session-historian-no-skill-tool.test.ts: 96 pass, 0 fail.discover-sessions.sh omp-support 7 --platform ompagainst a real~/.omp/agent/sessions/root finds the live session;extract-metadata.pyreportsplatform: "omp"with the correct cwd and 0 parse errors.src/session/session-paths.ts) and changelog (#7646).Security Disclosure
One shell change in a skill:
skills/ce-compound/scripts/session-history/discover-sessions.shgainsdiscover_omp(), which reads omp session JSONL from$HOME/${PI_CONFIG_DIR:-.omp}-rooted paths (plus the existingPI_CODING_AGENT_SESSION_DIR/PI_CODING_AGENT_DIRoverrides, same trust model as the pre-existingdiscover_pi()). All globs are guarded and no user-controlled input is interpolated beyond the establishedREPO_NAME/--cwdparameters. The Python extractors gain read-only omp branches (title-slot skip,try_ompdetection). No new network access, credential handling, permissions, or dependencies. Residual risk: none identified beyond the existing pi path's.Agent Disclosure
Oh My Pi (omp) · kimi-code/k3