Skip to content

feat(ce-compound): recognize oh-my-pi (omp) session history - #1333

Open
caelaxie wants to merge 1 commit into
EveryInc:mainfrom
caelaxie:caelaxie/omp-session-history
Open

feat(ce-compound): recognize oh-my-pi (omp) session history#1333
caelaxie wants to merge 1 commit into
EveryInc:mainfrom
caelaxie:caelaxie/omp-session-history

Conversation

@caelaxie

@caelaxie caelaxie commented Aug 5, 2026

Copy link
Copy Markdown

Summary

Adds oh-my-pi (omp) as a fifth ce-compound session-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.sh

  • New discover_omp() + --platform omp arm. Scans ${PI_CODING_AGENT_DIR:-$HOME/${PI_CONFIG_DIR:-.omp}/agent}/sessions and named-profile roots ~/.omp/profiles/*/agent/sessions, and honors a flat PI_CODING_AGENT_SESSION_DIR override.
  • Probes both omp bucket naming schemes: the raw -<home-rel> / -tmp-<rel> / --<abs>-- scheme (current again since 17.2.9, verified against the installed 17.2.9 source src/session/session-paths.ts) and the intermediate hashed <scope>-<sanitized-basename>-<sha256> scheme. The raw probe canonicalizes --cwd with physical paths to mirror omp's resolveEquivalentPath; the basename glob covers both raw and sanitized forms so buckets are found even when --cwd cannot be resolved.
  • The all arm deduplicates the combined discoverer output (awk '!seen[$0]++'), since the shared PI_CODING_AGENT_SESSION_DIR flat override is scanned by both discover_pi and discover_omp. Exact repo attribution stays with the downstream header cwd filter — no bucket-name parsing is reimplemented for attribution.

Extraction — extract-metadata.py, extract-skeleton.py, extract-errors.py

  • try_omp runs before try_pi: omp session files physically begin with a 256-byte {"type":"title",...} slot line before the pi-shaped type:"session" header, which distinguishes them from pi files. Platform identity is omp.
  • Skeleton and errors extraction reuse the pi paths with the title-slot line skipped; title_change entries are unaffected.

Prose contracts

  • ce-compound SKILL.md session-root list and keyword-rerun clause (branchless omp metadata gets keyword extraction and a match_count the relevance gate can evaluate).
  • session-historian.md: input contract (platform = omp, cwd as Codex/Pi/omp metadata), cross-tool synthesis coverage, and provenance header.
  • docs/skills/ce-compound.md platform enumeration.

Tests

  • New fixture 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 omp restriction, 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.
  • End-to-end smoke (on feat(omp): add native oh-my-pi harness support #1323's branch, same code): discover-sessions.sh omp-support 7 --platform omp against a real ~/.omp/agent/sessions/ root finds the live session; extract-metadata.py reports platform: "omp" with the correct cwd and 0 parse errors.
  • Bucket-scheme claims verified against installed omp 17.2.9 source (src/session/session-paths.ts) and changelog (#7646).

Security Disclosure

One shell change in a skill: skills/ce-compound/scripts/session-history/discover-sessions.sh gains discover_omp(), which reads omp session JSONL from $HOME/${PI_CONFIG_DIR:-.omp}-rooted paths (plus the existing PI_CODING_AGENT_SESSION_DIR / PI_CODING_AGENT_DIR overrides, same trust model as the pre-existing discover_pi()). All globs are guarded and no user-controlled input is interpolated beyond the established REPO_NAME/--cwd parameters. The Python extractors gain read-only omp branches (title-slot skip, try_omp detection). No new network access, credential handling, permissions, or dependencies. Residual risk: none identified beyond the existing pi path's.

Agent Disclosure

  • Model: Oh My Pi (omp) · kimi-code/k3

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant