feat: add Oh My Pi support
Problem
Oh My Pi sessions were invisible to continues. OMP stores session transcripts as JSONL under $PI_CODING_AGENT_DIR/sessions/ (default ~/.omp/agent/sessions/), but there was no parser, registry entry, fixture, or cross-tool handoff path for it.
That meant starting work in OMP and handing it off to Codex, Claude, Gemini, OpenCode, etc. lost the entire session.
Before
$ continues list --source omp
# omp was not a supported source
After
$ continues list --source omp --json -n 1
[
{
"source": "omp",
"cwd": "/Users/kd-m2air/Local",
"summary": "Add OMP support",
"model": "openai-codex/gpt-5.5",
"originalPath": "/Users/kd-m2air/.omp/agent/sessions/...jsonl"
}
]
And OMP sessions can now generate normal handoff markdown:
# Session Handoff Context
## Session Overview
| Source | Oh My Pi |
| Session ID | `019f6a82-...` |
| Working Directory | `~/Local` |
| Session File | `~/.omp/agent/sessions/...jsonl` |
## Recent Conversation
...
## Tool Activity
...
## Session Origin
This session was extracted from **Oh My Pi** session data.
What changed
Added OMP as the 17th supported tool.
New parser support:
- Discovers OMP
.jsonlsessions from$PI_CODING_AGENT_DIR/sessions/*/*.jsonl - Defaults to
~/.omp/agent/sessions/ - Extracts session id, cwd, repo, title/summary, model, created/updated timestamps
- Keeps lightweight session ordering based on the latest OMP metadata
updatedAt - De-dupes duplicate session ids by newest
updatedAt
New handoff data extracted:
- User/assistant/system conversation messages
- Tool execution start/result pairs by
toolCallId - Shell/read/write/edit/grep/glob/search/MCP tool summaries via
SummaryCollector - Modified files from write/edit activity
- Model/provider metadata
- Token usage, cache tokens, thinking tokens
- Thinking level configuration
- Session lifecycle events
- Timeline events for messages, tool calls, tool results, and exits
CLI integration:
- Adds
omptoTOOL_NAMES - Registers OMP in
src/parsers/registry.ts - Exports
parseOmpSessions/extractOmpContext - Adds native resume display/args:
omp --resume <id> - Adds cross-tool handoff support with positional prompt argument
Docs and metadata:
- README supported-tool table now includes Oh My Pi
- README storage table documents
$PI_CODING_AGENT_DIR/sessions/ - Package description mentions Oh My Pi
- CHANGELOG has an Unreleased OMP entry
Technical approach
- Follows the existing parser contract:
parseOmpSessions()andextractOmpContext(). - Uses shared JSONL helpers instead of loading session files wholesale.
- Uses
scanJsonlHeadfor cheap metadata discovery andreadJsonlFileonly during full context extraction. - Uses
SummaryCollectorand existing summarizer helpers instead of OMP-specific markdown formatting. - Treats unknown/malformed records conservatively: skip what cannot be parsed, keep the session usable.
- Adds a regression test for lightweight recency because
continues list/pick/quick-resumecan use source indexes built without full transcript scans.
Files changed
| File / area | Purpose |
|---|---|
src/parsers/omp.ts | New OMP parser and handoff extractor. |
src/parsers/registry.ts | Register OMP source, storage path, native resume, and cross-tool args. |
src/types/tool-names.ts | Add omp to supported tool names and source union. |
src/parsers/index.ts | Export OMP parser functions. |
src/__tests__/omp-parser.test.ts | OMP discovery, extraction, and lightweight recency regression tests. |
src/__tests__/fixtures/index.ts | Sanitized OMP fixture factory. |
src/__tests__/unit-conversions.test.ts | Add OMP to source/target conversion matrix. |
src/__tests__/schemas.test.ts | Update supported-tool schema expectations. |
README.md, CHANGELOG.md, package.json | User-facing OMP support docs/metadata. |
Testing
Automated checks:
corepack pnpm@10 run buildcorepack pnpm@10 test- 29 test files passed
- 984 tests passed
- 2 skipped
npx -y node@22 node_modules/vitest/vitest.mjs run- verifies the suite under the CI Node 22 runtime
- 29 test files passed
- 984 tests passed
- 2 skipped
E2E smoke against real local OMP data:
npm run dev -- scan --rebuild- found OMP sessions
npm run dev -- list --source omp --json -n 1- returned a real OMP session from
~/.omp/agent/sessions/...jsonl
- returned a real OMP session from
npm run dev -- resume 019f6a82 -i codex --debug-prompt --no-tui- generated a Codex handoff from an OMP session
Review pass:
- Ran an internal reviewer pass before opening the PR.
- Reviewer found one correctness issue: lightweight OMP indexing could order sessions by stale timestamps.
- Added a failing regression test first, then fixed timestamp handling to keep
updatedAtmonotonic.
Risks / reviewer focus
- OMP schema drift — parser is tolerant, but new record shapes may need follow-up coverage.
- Tool result pairing — tool summaries depend on
tool_execution_startand latertoolResultmessages sharingtoolCallId; missing results still produce conservative summaries. - Native resume contract — assumes
omp --resume <id>is the right CLI shape. - Cross-tool prompt contract — assumes OMP accepts the handoff prompt as a positional message argument.
Follow-ups
- Add parser-documentation pages for OMP storage/message/tool-call formats if this repo wants docs parity with older tools.
- Add live sanitized OMP fixture samples if the project prefers fixtures copied from real sessions over synthetic records.
Summary by cubic
Adds Oh My Pi (OMP) as a first-class source: we discover, parse, and extract handoffs from OMP JSONL sessions and support native resume. This brings supported tools to 17 and updates docs accordingly.
-
New Features
- OMP session discovery and parsing from
$PI_CODING_AGENT_DIR/sessions/(default~/.omp/agent/sessions/), with lightweight recency ordering. - Context extraction: recent messages, tool calls/results, model notes, token/cache usage, thinking level, and lifecycle; handoff markdown and timeline included.
- Registry/CLI integration: new
ompsource with list/inspect/dump; native resume viaomp --resume <id>and cross-tool handoff. - Tests and fixtures: new
ompfixtures and parser tests; e2e/unit paths updated across sources. - Docs and metadata updated (
README.md,CHANGELOG.md,package.json); minor lint and import path cleanups.
- OMP session discovery and parsing from
-
Migration
- No changes required. Optionally set
PI_CODING_AGENT_DIR; otherwise the default~/.omp/agent/sessions/is used. - Try it:
continues list --source omp -n 1andcontinues resume <id> -i codex
- No changes required. Optionally set